aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
authorYang Yingliang <yangyingliang@huawei.com>2023-08-04 11:22:15 +0800
committerTejun Heo <tj@kernel.org>2023-08-07 08:36:51 -1000
commit9680540c0c56a1f75a2d6aab31bf38aa429aa9d9 (patch)
treeba5ada7e82537495bc8d57655c91b849c4b9ab2b /kernel/workqueue.c
parentace3c5499e61ef7c0433a7a297227a9bdde54a55 (diff)
downloadlinux-9680540c0c56a1f75a2d6aab31bf38aa429aa9d9.tar.gz
workqueue: use LIST_HEAD to initialize cull_list
Use LIST_HEAD() to initialize cull_list instead of open-coding it. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Reviewed-by: Lai Jiangshan <jiangshanlai@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r--kernel/workqueue.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 83f8993af57cf..a90f1e6425489 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -2304,9 +2304,8 @@ static void idle_worker_timeout(struct timer_list *t)
static void idle_cull_fn(struct work_struct *work)
{
struct worker_pool *pool = container_of(work, struct worker_pool, idle_cull_work);
- struct list_head cull_list;
+ LIST_HEAD(cull_list);
- INIT_LIST_HEAD(&cull_list);
/*
* Grabbing wq_pool_attach_mutex here ensures an already-running worker
* cannot proceed beyong worker_detach_from_pool() in its self-destruct
@@ -3872,10 +3871,8 @@ static void rcu_free_pool(struct rcu_head *rcu)
static void put_unbound_pool(struct worker_pool *pool)
{
DECLARE_COMPLETION_ONSTACK(detach_completion);
- struct list_head cull_list;
struct worker *worker;
-
- INIT_LIST_HEAD(&cull_list);
+ LIST_HEAD(cull_list);
lockdep_assert_held(&wq_pool_mutex);