diff options
| author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2014-06-03 15:31:45 +0800 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2017-12-05 18:08:26 +0100 |
| commit | e35b3cf35ab2f1ffc128d01fb442a35c41d24303 (patch) | |
| tree | 1f279cb1575e829f5142e73519c1b248e56e0d03 /kernel/workqueue.c | |
| parent | 2c6236e0531df9dfc4ba6a4ef94aab93f86c89d6 (diff) | |
| download | android_kernel_m2note-e35b3cf35ab2f1ffc128d01fb442a35c41d24303.tar.gz | |
workqueue: use "pool->cpu < 0" to stand for an unbound pool
There is a piece of sanity checks code in the put_unbound_pool().
The meaning of this code is "if it is not an unbound pool, it will complain
and return" IIUC. But the code uses "pool->flags & POOL_DISASSOCIATED"
imprecisely due to a non-unbound pool may also have this flags.
We should use "pool->cpu < 0" to stand for an unbound pool, so we covert the
code to it.
There is no strictly wrong if we still keep "pool->flags & POOL_DISASSOCIATED"
here, but it is just a noise if we keep it:
1) we focus on "unbound" here, not "[dis]association".
2) "pool->cpu < 0" already implies "pool->flags & POOL_DISASSOCIATED".
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/workqueue.c')
| -rw-r--r-- | kernel/workqueue.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index f8697219b..d8ca72d28 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -3684,7 +3684,7 @@ static void put_unbound_pool(struct worker_pool *pool) return; /* sanity checks */ - if (WARN_ON(!(pool->flags & POOL_DISASSOCIATED)) || + if (WARN_ON(!(pool->cpu < 0)) || WARN_ON(!list_empty(&pool->worklist))) return; |
