[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230804032215.1168792-1-yangyingliang@huaweicloud.com>
Date: Fri, 4 Aug 2023 11:22:15 +0800
From: yangyingliang@...weicloud.com
To: linux-kernel@...r.kernel.org
Cc: tj@...nel.org, jiangshanlai@...il.com, yangyingliang@...wei.com
Subject: [PATCH -next resend] workqueue: use LIST_HEAD to initialize cull_list
From: Yang Yingliang <yangyingliang@...wei.com>
Use LIST_HEAD() to initialize cull_list instead of open-coding it.
Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
Reviewed-by: Lai Jiangshan <jiangshanlai@...il.com>
---
kernel/workqueue.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 3ddd0d599dab..ae975a7c9f69 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -2307,9 +2307,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
@@ -3875,10 +3874,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);
--
2.25.1
Powered by blists - more mailing lists