From: Ying Xue <ying.xue@windriver.com>
To: <netdev@vger.kernel.org>
Cc: <davem@davemloft.net>
Subject: [PATCH] net: remove redundant checking for sock timer state
Date: Fri, 1 Feb 2013 13:53:00 +0800 [thread overview]
Message-ID: <1359697980-28613-1-git-send-email-ying.xue@windriver.com> (raw)
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
next reply other threads:[~2013-02-01 5:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-01 5:53 Ying Xue [this message]
2013-02-01 6:09 ` [PATCH] net: remove redundant checking for sock timer state 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1359697980-28613-1-git-send-email-ying.xue@windriver.com \
--to=ying.xue@windriver.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).