diff options
author | Robert P. J. Day <rpjday@crashcourse.ca> | 2008-04-12 21:54:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-04-12 21:54:24 -0400 |
commit | 9dbc15f055f05393ace4f1733f160ec3d188cf9b (patch) | |
tree | c3aca36fdb57d7b64aa5d5fdea0b7cf048c88dc7 /net/sctp/sm_sideeffect.c | |
parent | 30e935600776b45db38238355f0de2b8f72b3847 (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_sideeffect.c')
-rw-r--r-- | net/sctp/sm_sideeffect.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c index 02bf32c30263..5fdb623d8281 100644 --- a/net/sctp/sm_sideeffect.c +++ b/net/sctp/sm_sideeffect.c | |||
@@ -545,14 +545,12 @@ static void sctp_cmd_hb_timers_start(sctp_cmd_seq_t *cmds, | |||
545 | struct sctp_association *asoc) | 545 | struct sctp_association *asoc) |
546 | { | 546 | { |
547 | struct sctp_transport *t; | 547 | struct sctp_transport *t; |
548 | struct list_head *pos; | ||
549 | 548 | ||
550 | /* Start a heartbeat timer for each transport on the association. | 549 | /* Start a heartbeat timer for each transport on the association. |
551 | * hold a reference on the transport to make sure none of | 550 | * hold a reference on the transport to make sure none of |
552 | * the needed data structures go away. | 551 | * the needed data structures go away. |
553 | */ | 552 | */ |
554 | list_for_each(pos, &asoc->peer.transport_addr_list) { | 553 | list_for_each_entry(t, &asoc->peer.transport_addr_list, transports) { |
555 | t = list_entry(pos, struct sctp_transport, transports); | ||
556 | 554 | ||
557 | if (!mod_timer(&t->hb_timer, sctp_transport_timeout(t))) | 555 | if (!mod_timer(&t->hb_timer, sctp_transport_timeout(t))) |
558 | sctp_transport_hold(t); | 556 | sctp_transport_hold(t); |
@@ -563,12 +561,11 @@ static void sctp_cmd_hb_timers_stop(sctp_cmd_seq_t *cmds, | |||
563 | struct sctp_association *asoc) | 561 | struct sctp_association *asoc) |
564 | { | 562 | { |
565 | struct sctp_transport *t; | 563 | struct sctp_transport *t; |
566 | struct list_head *pos; | ||
567 | 564 | ||
568 | /* Stop all heartbeat timers. */ | 565 | /* Stop all heartbeat timers. */ |
569 | 566 | ||
570 | list_for_each(pos, &asoc->peer.transport_addr_list) { | 567 | list_for_each_entry(t, &asoc->peer.transport_addr_list, |
571 | t = list_entry(pos, struct sctp_transport, transports); | 568 | transports) { |
572 | if (del_timer(&t->hb_timer)) | 569 | if (del_timer(&t->hb_timer)) |
573 | sctp_transport_put(t); | 570 | sctp_transport_put(t); |
574 | } | 571 | } |
@@ -579,10 +576,9 @@ static void sctp_cmd_t3_rtx_timers_stop(sctp_cmd_seq_t *cmds, | |||
579 | struct sctp_association *asoc) | 576 | struct sctp_association *asoc) |
580 | { | 577 | { |
581 | struct sctp_transport *t; | 578 | struct sctp_transport *t; |
582 | struct list_head *pos; | ||
583 | 579 | ||
584 | list_for_each(pos, &asoc->peer.transport_addr_list) { | 580 | list_for_each_entry(t, &asoc->peer.transport_addr_list, |
585 | t = list_entry(pos, struct sctp_transport, transports); | 581 | transports) { |
586 | if (timer_pending(&t->T3_rtx_timer) && | 582 | if (timer_pending(&t->T3_rtx_timer) && |
587 | del_timer(&t->T3_rtx_timer)) { | 583 | del_timer(&t->T3_rtx_timer)) { |
588 | sctp_transport_put(t); | 584 | sctp_transport_put(t); |
@@ -1065,7 +1061,6 @@ static int sctp_cmd_interpreter(sctp_event_t event_type, | |||
1065 | struct sctp_chunk *new_obj; | 1061 | struct sctp_chunk *new_obj; |
1066 | struct sctp_chunk *chunk = NULL; | 1062 | struct sctp_chunk *chunk = NULL; |
1067 | struct sctp_packet *packet; | 1063 | struct sctp_packet *packet; |
1068 | struct list_head *pos; | ||
1069 | struct timer_list *timer; | 1064 | struct timer_list *timer; |
1070 | unsigned long timeout; | 1065 | unsigned long timeout; |
1071 | struct sctp_transport *t; | 1066 | struct sctp_transport *t; |
@@ -1397,9 +1392,8 @@ static int sctp_cmd_interpreter(sctp_event_t event_type, | |||
1397 | /* If we've sent any data bundled with | 1392 | /* If we've sent any data bundled with |
1398 | * COOKIE-ECHO we need to resend. | 1393 | * COOKIE-ECHO we need to resend. |
1399 | */ | 1394 | */ |
1400 | list_for_each(pos, &asoc->peer.transport_addr_list) { | 1395 | list_for_each_entry(t, &asoc->peer.transport_addr_list, |
1401 | t = list_entry(pos, struct sctp_transport, | 1396 | transports) { |
1402 | transports); | ||
1403 | sctp_retransmit_mark(&asoc->outqueue, t, | 1397 | sctp_retransmit_mark(&asoc->outqueue, t, |
1404 | SCTP_RTXR_T1_RTX); | 1398 | SCTP_RTXR_T1_RTX); |
1405 | } | 1399 | } |