netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: remove redundant checking for sock timer state
@ 2013-02-01  5:53 Ying Xue
  2013-02-01  6:09 ` David Miller
  0 siblings, 1 reply; 9+ messages in thread
From: Ying Xue @ 2013-02-01  5:53 UTC (permalink / raw)
  To: netdev; +Cc: davem

It's unnecessary to check whether the sock timer to be stopped is
pending or not in sk_stop_timer() as del_timer() will do the same
thing later.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
---
 net/core/sock.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/core/sock.c b/net/core/sock.c
index bc131d4..33144bd 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -2212,7 +2212,7 @@ EXPORT_SYMBOL(sk_reset_timer);
 
 void sk_stop_timer(struct sock *sk, struct timer_list* timer)
 {
-	if (timer_pending(timer) && del_timer(timer))
+	if (del_timer(timer))
 		__sock_put(sk);
 }
 EXPORT_SYMBOL(sk_stop_timer);
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-02-01 15:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-01  5:53 [PATCH] net: remove redundant checking for sock timer state Ying Xue
2013-02-01  6:09 ` David Miller
2013-02-01  6:26   ` Eric Dumazet
2013-02-01  7:14     ` Xue Ying
2013-02-01  7:21       ` Eric Dumazet
2013-02-01  7:25         ` Ying Xue
2013-02-01  9:26         ` David Laight
2013-02-01 15:22           ` Eric Dumazet
2013-02-01  6:32   ` Ying Xue

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).