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 <[email protected]>
Cc: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
Ying Xue 2013-02-03 20:32:57 +00:00 • committed by David S. Miller
commit 25cc4ae913
11 changed files with 21 additions and 38 deletions

View file

@ -257,7 +257,7 @@ static void rfcomm_session_clear_timer(struct rfcomm_session *s)
{
BT_DBG("session %p state %ld", s, s->state);
if (timer_pending(&s->timer) && del_timer(&s->timer))
if (del_timer(&s->timer))
rfcomm_session_put(s);
}
@ -285,7 +285,7 @@ static void rfcomm_dlc_clear_timer(struct rfcomm_dlc *d)
{
BT_DBG("dlc %p state %ld", d, d->state);
if (timer_pending(&d->timer) && del_timer(&d->timer))
if (del_timer(&d->timer))
rfcomm_dlc_put(d);
}