[PATCH 25/25] ipc: don't use [delayed_]work_pending()

From: Tejun Heo
Date: Fri Dec 21 2012 - 20:58:52 EST


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 ipc. Only compile tested.

Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---
Please let me know how this patch should be routed. I can take it
through the workqueue tree if necessary.

Thanks.

ipc/util.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/ipc/util.c b/ipc/util.c
index 72fd078..add2776 100644
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -71,8 +71,7 @@ static int ipc_memory_callback(struct notifier_block *self,
* activate the ipcns notification chain.
* No need to keep several ipc work items on the queue.
*/
- if (!work_pending(&ipc_memory_wq))
- schedule_work(&ipc_memory_wq);
+ schedule_work(&ipc_memory_wq);
break;
case MEM_GOING_ONLINE:
case MEM_GOING_OFFLINE:
--
1.8.0.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/