aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/proc.c
diff options
context:
space:
mode:
authorRobert P. J. Day <rpjday@crashcourse.ca>2008-04-12 21:54:24 -0400
committerDavid S. Miller <davem@davemloft.net>2008-04-12 21:54:24 -0400
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)
124/* Dump local addresses of an association/endpoint. */ 124/* Dump local addresses of an association/endpoint. */
125static void sctp_seq_dump_local_addrs(struct seq_file *seq, struct sctp_ep_common *epb) 125static void sctp_seq_dump_local_addrs(struct seq_file *seq, struct sctp_ep_common *epb)
126{ 126{
127 struct list_head *pos;
128 struct sctp_association *asoc; 127 struct sctp_association *asoc;
129 struct sctp_sockaddr_entry *laddr; 128 struct sctp_sockaddr_entry *laddr;
130 struct sctp_transport *peer; 129 struct sctp_transport *peer;
@@ -137,8 +136,7 @@ static void sctp_seq_dump_local_addrs(struct seq_file *seq, struct sctp_ep_commo
137 primary = &peer->saddr; 136 primary = &peer->saddr;
138 } 137 }
139 138
140 list_for_each(pos, &epb->bind_addr.address_list) { 139 list_for_each_entry(laddr, &epb->bind_addr.address_list, list) {
141 laddr = list_entry(pos, struct sctp_sockaddr_entry, list);
142 addr = &laddr->a; 140 addr = &laddr->a;
143 af = sctp_get_af_specific(addr->sa.sa_family); 141 af = sctp_get_af_specific(addr->sa.sa_family);
144 if (primary && af->cmp_addr(addr, primary)) { 142 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
151/* Dump remote addresses of an association. */ 149/* Dump remote addresses of an association. */
152static void sctp_seq_dump_remote_addrs(struct seq_file *seq, struct sctp_association *assoc) 150static void sctp_seq_dump_remote_addrs(struct seq_file *seq, struct sctp_association *assoc)
153{ 151{
154 struct list_head *pos;
155 struct sctp_transport *transport; 152 struct sctp_transport *transport;
156 union sctp_addr *addr, *primary; 153 union sctp_addr *addr, *primary;
157 struct sctp_af *af; 154 struct sctp_af *af;
158 155
159 primary = &assoc->peer.primary_addr; 156 primary = &assoc->peer.primary_addr;
160 list_for_each(pos, &assoc->peer.transport_addr_list) { 157 list_for_each_entry(transport, &assoc->peer.transport_addr_list,
161 transport = list_entry(pos, struct sctp_transport, transports); 158 transports) {
162 addr = &transport->ipaddr; 159 addr = &transport->ipaddr;
163 af = sctp_get_af_specific(addr->sa.sa_family); 160 af = sctp_get_af_specific(addr->sa.sa_family);
164 if (af->cmp_addr(addr, primary)) { 161 if (af->cmp_addr(addr, primary)) {