From: Tejun Heo <tj@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Tejun Heo <tj@kernel.org>,
"John W. Linville" <linville@tuxdriver.com>,
linux-wireless@vger.kernel.org
Subject: [PATCH 14/25] rfkill: don't use [delayed_]work_pending()
Date: Fri, 21 Dec 2012 17:57:04 -0800 [thread overview]
Message-ID: <1356141435-17340-15-git-send-email-tj@kernel.org> (raw)
In-Reply-To: <1356141435-17340-1-git-send-email-tj@kernel.org>
There's no need to test whether a (delayed) work item in pending
before queueing, flushing or cancelling it. Most uses are unnecessary
and quite a few of them are buggy.
Remove unnecessary pending tests from rfkill. Only compile
tested.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
---
Please let me know how this patch should be routed. I can take it
through the workqueue tree if necessary.
Thanks.
net/rfkill/input.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/net/rfkill/input.c b/net/rfkill/input.c
index c9d931e..b85107b 100644
--- a/net/rfkill/input.c
+++ b/net/rfkill/input.c
@@ -148,11 +148,9 @@ static unsigned long rfkill_ratelimit(const unsigned long last)
static void rfkill_schedule_ratelimited(void)
{
- if (delayed_work_pending(&rfkill_op_work))
- return;
- schedule_delayed_work(&rfkill_op_work,
- rfkill_ratelimit(rfkill_last_scheduled));
- rfkill_last_scheduled = jiffies;
+ if (schedule_delayed_work(&rfkill_op_work,
+ rfkill_ratelimit(rfkill_last_scheduled)))
+ rfkill_last_scheduled = jiffies;
}
static void rfkill_schedule_global_op(enum rfkill_sched_op op)
--
1.8.0.2
next prev parent reply other threads:[~2012-12-22 1:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1356141435-17340-1-git-send-email-tj@kernel.org>
2012-12-22 1:56 ` [PATCH 04/25] ipw2x00: simplify scan_event handling Tejun Heo
2013-01-27 21:02 ` Stanislav Yakovlev
2013-02-09 19:31 ` Tejun Heo
2012-12-22 1:56 ` [PATCH 06/25] libertas: don't use [delayed_]work_pending() Tejun Heo
2012-12-22 1:56 ` [PATCH 07/25] mwifiex: " Tejun Heo
2012-12-22 22:29 ` Bing Zhao
2012-12-28 21:41 ` Tejun Heo
2012-12-22 1:56 ` [PATCH 09/25] wl1251: " Tejun Heo
2012-12-22 14:14 ` Luciano Coelho
2012-12-28 21:42 ` Tejun Heo
2012-12-22 1:57 ` Tejun Heo [this message]
2012-12-22 20:22 ` [PATCH 14/25] rfkill: " Johannes Berg
2012-12-28 21:42 ` Tejun Heo
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=1356141435-17340-15-git-send-email-tj@kernel.org \
--to=tj@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/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).