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/associola.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/associola.c')
-rw-r--r-- | net/sctp/associola.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/sctp/associola.c b/net/sctp/associola.c index b45ed1f96921..2f95f5a5145d 100644 --- a/net/sctp/associola.c +++ b/net/sctp/associola.c | |||
@@ -434,8 +434,7 @@ void sctp_association_free(struct sctp_association *asoc) | |||
434 | * on our state. | 434 | * on our state. |
435 | */ | 435 | */ |
436 | for (i = SCTP_EVENT_TIMEOUT_NONE; i < SCTP_NUM_TIMEOUT_TYPES; ++i) { | 436 | for (i = SCTP_EVENT_TIMEOUT_NONE; i < SCTP_NUM_TIMEOUT_TYPES; ++i) { |
437 | if (timer_pending(&asoc->timers[i]) && | 437 | if (del_timer(&asoc->timers[i])) |
438 | del_timer(&asoc->timers[i])) | ||
439 | sctp_association_put(asoc); | 438 | sctp_association_put(asoc); |
440 | } | 439 | } |
441 | 440 | ||
@@ -1497,7 +1496,7 @@ void sctp_assoc_rwnd_increase(struct sctp_association *asoc, unsigned int len) | |||
1497 | 1496 | ||
1498 | /* Stop the SACK timer. */ | 1497 | /* Stop the SACK timer. */ |
1499 | timer = &asoc->timers[SCTP_EVENT_TIMEOUT_SACK]; | 1498 | timer = &asoc->timers[SCTP_EVENT_TIMEOUT_SACK]; |
1500 | if (timer_pending(timer) && del_timer(timer)) | 1499 | if (del_timer(timer)) |
1501 | sctp_association_put(asoc); | 1500 | sctp_association_put(asoc); |
1502 | } | 1501 | } |
1503 | } | 1502 | } |