aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/sm_statefuns.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/sm_statefuns.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/sm_statefuns.c')
-rw-r--r--net/sctp/sm_statefuns.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index b534dbef864f..622284805500 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -1226,7 +1226,6 @@ static int sctp_sf_check_restart_addrs(const struct sctp_association *new_asoc,
1226 sctp_cmd_seq_t *commands) 1226 sctp_cmd_seq_t *commands)
1227{ 1227{
1228 struct sctp_transport *new_addr, *addr; 1228 struct sctp_transport *new_addr, *addr;
1229 struct list_head *pos, *pos2;
1230 int found; 1229 int found;
1231 1230
1232 /* Implementor's Guide - Sectin 5.2.2 1231 /* Implementor's Guide - Sectin 5.2.2
@@ -1243,12 +1242,11 @@ static int sctp_sf_check_restart_addrs(const struct sctp_association *new_asoc,
1243 new_addr = NULL; 1242 new_addr = NULL;
1244 found = 0; 1243 found = 0;
1245 1244
1246 list_for_each(pos, &new_asoc->peer.transport_addr_list) { 1245 list_for_each_entry(new_addr, &new_asoc->peer.transport_addr_list,
1247 new_addr = list_entry(pos, struct sctp_transport, transports); 1246 transports) {
1248 found = 0; 1247 found = 0;
1249 list_for_each(pos2, &asoc->peer.transport_addr_list) { 1248 list_for_each_entry(addr, &asoc->peer.transport_addr_list,
1250 addr = list_entry(pos2, struct sctp_transport, 1249 transports) {
1251 transports);
1252 if (sctp_cmp_addr_exact(&new_addr->ipaddr, 1250 if (sctp_cmp_addr_exact(&new_addr->ipaddr,
1253 &addr->ipaddr)) { 1251 &addr->ipaddr)) {
1254 found = 1; 1252 found = 1;