summaryrefslogtreecommitdiff
path: root/net/sctp/proc.c
diff options
context:
space:
mode:
authorRobert P. J. Day <rpjday@crashcourse.ca>2008-04-12 18:54:24 -0700
committerDavid S. Miller <davem@davemloft.net>2008-04-12 18:54:24 -0700
commit9dbc15f055f05393ace4f1733f160ec3d188cf9b (patch)
treec3aca36fdb57d7b64aa5d5fdea0b7cf048c88dc7 /net/sctp/proc.c
parent30e935600776b45db38238355f0de2b8f72b3847 (diff)
[SCTP]: "list_for_each()" -> "list_for_each_entry()" where appropriate.
Replacing (almost) all invocations of list_for_each() with list_for_each_entry() tightens up the code and allows for the deletion of numerous list iterator variables that are no longer necessary. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/proc.c')
-rw-r--r--net/sctp/proc.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/net/sctp/proc.c b/net/sctp/proc.c
index 99062f5f42e3..0aba759cb9b7 100644
--- a/net/sctp/proc.c
+++ b/net/sctp/proc.c
@@ -124,7 +124,6 @@ void sctp_snmp_proc_exit(void)
/* Dump local addresses of an association/endpoint. */
static void sctp_seq_dump_local_addrs(struct seq_file *seq, struct sctp_ep_common *epb)
{
- struct list_head *pos;
struct sctp_association *asoc;
struct sctp_sockaddr_entry *laddr;
struct sctp_transport *peer;
@@ -137,8 +136,7 @@ static void sctp_seq_dump_local_addrs(struct seq_file *seq, struct sctp_ep_commo
primary = &peer->saddr;
}
- list_for_each(pos, &epb->bind_addr.address_list) {
- laddr = list_entry(pos, struct sctp_sockaddr_entry, list);
+ list_for_each_entry(laddr, &epb->bind_addr.address_list, list) {
addr = &laddr->a;
af = sctp_get_af_specific(addr->sa.sa_family);
if (primary && af->cmp_addr(addr, primary)) {
@@ -151,14 +149,13 @@ static void sctp_seq_dump_local_addrs(struct seq_file *seq, struct sctp_ep_commo
/* Dump remote addresses of an association. */
static void sctp_seq_dump_remote_addrs(struct seq_file *seq, struct sctp_association *assoc)
{
- struct list_head *pos;
struct sctp_transport *transport;
union sctp_addr *addr, *primary;
struct sctp_af *af;
primary = &assoc->peer.primary_addr;
- list_for_each(pos, &assoc->peer.transport_addr_list) {
- transport = list_entry(pos, struct sctp_transport, transports);
+ list_for_each_entry(transport, &assoc->peer.transport_addr_list,
+ transports) {
addr = &transport->ipaddr;
af = sctp_get_af_specific(addr->sa.sa_family);
if (af->cmp_addr(addr, primary)) {