rfkill: don't use [delayed_]work_pending()
authorTejun Heo <tj@kernel.org>
Sat, 22 Dec 2012 01:57:04 +0000 (17:57 -0800)
committerTejun Heo <tj@kernel.org>
Fri, 28 Dec 2012 21:40:16 +0000 (13:40 -0800)
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>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
net/rfkill/input.c

index c9d931e..b85107b 100644 (file)
@@ -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)