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/ipv4 | |
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/ipv4')
-rw-r--r-- | net/ipv4/netfilter/ipt_ULOG.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/net/ipv4/netfilter/ipt_ULOG.c b/net/ipv4/netfilter/ipt_ULOG.c index b5ef3cba2250..7d168dcbd135 100644 --- a/net/ipv4/netfilter/ipt_ULOG.c +++ b/net/ipv4/netfilter/ipt_ULOG.c | |||
@@ -88,10 +88,8 @@ static void ulog_send(unsigned int nlgroupnum) | |||
88 | { | 88 | { |
89 | ulog_buff_t *ub = &ulog_buffers[nlgroupnum]; | 89 | ulog_buff_t *ub = &ulog_buffers[nlgroupnum]; |
90 | 90 | ||
91 | if (timer_pending(&ub->timer)) { | 91 | pr_debug("ulog_send: timer is deleting\n"); |
92 | pr_debug("ulog_send: timer was pending, deleting\n"); | 92 | del_timer(&ub->timer); |
93 | del_timer(&ub->timer); | ||
94 | } | ||
95 | 93 | ||
96 | if (!ub->skb) { | 94 | if (!ub->skb) { |
97 | pr_debug("ulog_send: nothing to send\n"); | 95 | pr_debug("ulog_send: nothing to send\n"); |
@@ -426,10 +424,8 @@ static void __exit ulog_tg_exit(void) | |||
426 | /* remove pending timers and free allocated skb's */ | 424 | /* remove pending timers and free allocated skb's */ |
427 | for (i = 0; i < ULOG_MAXNLGROUPS; i++) { | 425 | for (i = 0; i < ULOG_MAXNLGROUPS; i++) { |
428 | ub = &ulog_buffers[i]; | 426 | ub = &ulog_buffers[i]; |
429 | if (timer_pending(&ub->timer)) { | 427 | pr_debug("timer is deleting\n"); |
430 | pr_debug("timer was pending, deleting\n"); | 428 | del_timer(&ub->timer); |
431 | del_timer(&ub->timer); | ||
432 | } | ||
433 | 429 | ||
434 | if (ub->skb) { | 430 | if (ub->skb) { |
435 | kfree_skb(ub->skb); | 431 | kfree_skb(ub->skb); |