From patchwork Sat Dec 22 01:57:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 1905321 Return-Path: X-Original-To: patchwork-linux-pm@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 8485DDFAC4 for ; Sat, 22 Dec 2012 02:05:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751855Ab2LVCFe (ORCPT ); Fri, 21 Dec 2012 21:05:34 -0500 Received: from mail-ia0-f171.google.com ([209.85.210.171]:40655 "EHLO mail-ia0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751352Ab2LVCFd (ORCPT ); Fri, 21 Dec 2012 21:05:33 -0500 X-Greylist: delayed 424 seconds by postgrey-1.27 at vger.kernel.org; Fri, 21 Dec 2012 21:05:33 EST Received: by mail-ia0-f171.google.com with SMTP id k27so4549236iad.30 for ; Fri, 21 Dec 2012 18:05:33 -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=qu7fDOCYILHq/14KKxqfcCukQl3Mhdqlmu5wzPUOqMA=; b=F8+FjCT9obvr+IKub2bZZ1UfIPgL9XsHAsgQW2LOfAwOObtPJQ6sDpDBEnnLvKysSK HpfvgiKhBQsLEY1ViJTGl+ztS/FgB/Pe20Xdo9pznXUlDdAh8uYcxRfaToecijGsHv4X IwYeF+ZVxiPWlXL+lYWMlxvv5LW40JecIgQ0/NJbgso1FaJ68Byol/N6Y7nIBGSk/Ntn 6+XHF90oLu3RmwVnQZDUNcLXY+eML0mwb6jpUNs2otphrfYeDFp+az0ksqzY2ZVJyw+r Vqhw+DpFrn44PFcjmUgBeXIh4x+hL/IzEsZBYhnW5WMFXQPYAHn4rFWWC9umpn6kvBRX BWMA== X-Received: by 10.50.6.169 with SMTP id c9mr15308735iga.24.1356141508854; Fri, 21 Dec 2012 17:58:28 -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.26 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 21 Dec 2012 17:58:28 -0800 (PST) From: Tejun Heo To: linux-kernel@vger.kernel.org Cc: Tejun Heo , "Rafael J. Wysocki" , linux-pm@vger.kernel.org Subject: [PATCH 16/25] PM / Domains: don't use [delayed_]work_pending() Date: Fri, 21 Dec 2012 17:57:06 -0800 Message-Id: <1356141435-17340-17-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-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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 power domains. Only compile tested. Signed-off-by: Tejun Heo Cc: Rafael J. Wysocki Cc: linux-pm@vger.kernel.org --- Please let me know how this patch should be routed. I can take it through the workqueue tree if necessary. Thanks. drivers/base/power/domain.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index acc3a8d..9a6b05a 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -433,8 +433,7 @@ static bool genpd_abort_poweroff(struct generic_pm_domain *genpd) */ void genpd_queue_power_off_work(struct generic_pm_domain *genpd) { - if (!work_pending(&genpd->power_off_work)) - queue_work(pm_wq, &genpd->power_off_work); + queue_work(pm_wq, &genpd->power_off_work); } /**