diff options
author | Ying Xue <ying.xue@windriver.com> | 2013-02-03 15:32:57 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-02-04 13:26:49 -0500 |
commit | 25cc4ae913a46bcc11b03c37bec59568f2122a36 (patch) | |
tree | 0a69dfa2c245d48fb44c6f2ab8e93587cf8516a7 /net/sctp/sm_sideeffect.c | |
parent | 2b3c9a850c3f2da7430c39dde0fb5cab56f8501d (diff) |
net: remove redundant check for timer pending state before del_timer
As in del_timer() there has already placed a timer_pending() function
to check whether the timer to be deleted is pending or not, it's
unnecessary to check timer pending state again before del_timer() is
called.
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Cc: Eric Dumazet <edumazet@google.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 | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c index c9577754a708..8aab894aeabe 100644 --- a/net/sctp/sm_sideeffect.c +++ b/net/sctp/sm_sideeffect.c | |||
@@ -674,10 +674,8 @@ static void sctp_cmd_t3_rtx_timers_stop(sctp_cmd_seq_t *cmds, | |||
674 | 674 | ||
675 | list_for_each_entry(t, &asoc->peer.transport_addr_list, | 675 | list_for_each_entry(t, &asoc->peer.transport_addr_list, |
676 | transports) { | 676 | transports) { |
677 | if (timer_pending(&t->T3_rtx_timer) && | 677 | if (del_timer(&t->T3_rtx_timer)) |
678 | del_timer(&t->T3_rtx_timer)) { | ||
679 | sctp_transport_put(t); | 678 | sctp_transport_put(t); |
680 | } | ||
681 | } | 679 | } |
682 | } | 680 | } |
683 | 681 | ||
@@ -1517,7 +1515,7 @@ static int sctp_cmd_interpreter(sctp_event_t event_type, | |||
1517 | 1515 | ||
1518 | case SCTP_CMD_TIMER_STOP: | 1516 | case SCTP_CMD_TIMER_STOP: |
1519 | timer = &asoc->timers[cmd->obj.to]; | 1517 | timer = &asoc->timers[cmd->obj.to]; |
1520 | if (timer_pending(timer) && del_timer(timer)) | 1518 | if (del_timer(timer)) |
1521 | sctp_association_put(asoc); | 1519 | sctp_association_put(asoc); |
1522 | break; | 1520 | break; |
1523 | 1521 | ||