Thread (5 messages) 5 messages, 2 authors, 2012-12-26

Re: [PATCH 16/25] PM / Domains: don't use [delayed_]work_pending()

From: Rafael J. Wysocki <hidden>
Date: 2012-12-22 11:52:04
Also in: lkml

On Friday, December 21, 2012 05:57:06 PM Tejun Heo wrote:
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.
Is the particular one you're removing from domain.c buggy?
Remove unnecessary pending tests from power domains.  Only compile
tested.
I can take this one too.

Thanks,
Rafael

quoted hunk ↗ jump to hunk
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Rafael J. Wysocki <redacted>
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);
 }
 
 /**
-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help