Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba0c96cd authored by Tejun Heo's avatar Tejun Heo
Browse files

rfkill: don't use [delayed_]work_pending()



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: default avatarTejun Heo <tj@kernel.org>
Acked-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
parent 02957f92
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -148,10 +148,8 @@ 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));
	if (schedule_delayed_work(&rfkill_op_work,
				  rfkill_ratelimit(rfkill_last_scheduled)))
		rfkill_last_scheduled = jiffies;
}