From patchwork Sat Dec 22 01:57:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 1905221 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 314D8DFAC4 for ; Sat, 22 Dec 2012 02:02:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752729Ab2LVCCR (ORCPT ); Fri, 21 Dec 2012 21:02:17 -0500 Received: from mail-ie0-f178.google.com ([209.85.223.178]:40826 "EHLO mail-ie0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752674Ab2LVB6Z (ORCPT ); Fri, 21 Dec 2012 20:58:25 -0500 Received: by mail-ie0-f178.google.com with SMTP id c12so7220453ieb.9 for ; Fri, 21 Dec 2012 17:58:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=ybADCIqzIR9PmHh4YNEXttyhOyBBNPnAcHGTf+tVqAc=; b=OoHG0EmKVpiKxAeYLnJ4k6KKaJoYJXEOXTzwLBQ5zHtbnZXDRZe4mmkf/I+xJfdleY ZQefgbeKEanJHiFywmgVU03ESVPChEA6tbOwfujEuBZWIFnGPx3MRbrOxwvooXF8sagz q8mKbrYallp5PRSutVwUNwyJDMxe54J2OtLWsE+7NiDYTdqlS9kBB2LSnuVGuQ5bRY/E fybtrxn01HcrD5eX3M2neWadpQbadlJuqAaLLJqUxqv3OB41piMErIAw6hDEYeKDAJlw IN5KIjaVlSjrWblEZBvDQ7fHatJwvwvpBJhu/ZcWrGnVH1PT8nPImzYOieOQXbOp9Wb1 YM6g== X-Received: by 10.42.48.147 with SMTP id s19mr13070571icf.18.1356141504763; Fri, 21 Dec 2012 17:58:24 -0800 (PST) Received: from htj.dyndns.org.com (c-69-181-251-227.hsd1.ca.comcast.net. [69.181.251.227]) by mx.google.com with ESMTPS id v12sm10975374igv.3.2012.12.21.17.58.22 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 21 Dec 2012 17:58:24 -0800 (PST) From: Tejun Heo To: linux-kernel@vger.kernel.org Cc: Tejun Heo , "John W. Linville" , 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 Message-Id: <1356141435-17340-15-git-send-email-tj@kernel.org> X-Mailer: git-send-email 1.8.0.2 In-Reply-To: <1356141435-17340-1-git-send-email-tj@kernel.org> References: <1356141435-17340-1-git-send-email-tj@kernel.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.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 Cc: "John W. Linville" 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)