Skip to contentSkip to conversation

wait: use LIST_HEAD_INIT() to initialize wait_queue_head

PATCH Applied Julian Wiedmann 2 participants 2 messages Jun 1, 2021 – Jun 28, 2021 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wait: use LIST_HEAD_INIT() to initialize wait_queue_head

Replace the open-coded initialization with the right macro.

---
 include/linux/wait.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/wait.h +1 -1
index fe10e8570a52..99c5f05718cd 100644
@@ -56,7 +56,7 @@ struct task_struct;
 
 #define __WAIT_QUEUE_HEAD_INITIALIZER(name) {					\
 	.lock		= __SPIN_LOCK_UNLOCKED(name.lock),			\
-	.head		= { &(name).head, &(name).head } }
+	.head		= LIST_HEAD_INIT(name.head) }
 
 #define DECLARE_WAIT_QUEUE_HEAD(name) \
 	struct wait_queue_head name = __WAIT_QUEUE_HEAD_INITIALIZER(name)
Signature · 1 line
2.25.1
#1 lore raw
The following commit has been merged into the sched/core branch of tip:

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     77eccd0dfae353a64a2088d308bed3b373a4220f
Gitweb:        https://git.kernel.org/tip/77eccd0dfae353a64a2088d308bed3b373a4220f
Author:        Julian Wiedmann <[email protected]>
AuthorDate:    Tue, 01 Jun 2021 17:11:20 +02:00
Committer:     Peter Zijlstra <[email protected]>
CommitterDate: Mon, 28 Jun 2021 15:42:25 +02:00

wait: use LIST_HEAD_INIT() to initialize wait_queue_head

Replace the open-coded initialization with the right macro.

---
 include/linux/wait.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/wait.h +1 -1
index fe10e85..99c5f05 100644
@@ -56,7 +56,7 @@ struct task_struct;
 
 #define __WAIT_QUEUE_HEAD_INITIALIZER(name) {					\
 	.lock		= __SPIN_LOCK_UNLOCKED(name.lock),			\
-	.head		= { &(name).head, &(name).head } }
+	.head		= LIST_HEAD_INIT(name.head) }
 
 #define DECLARE_WAIT_QUEUE_HEAD(name) \
 	struct wait_queue_head name = __WAIT_QUEUE_HEAD_INITIALIZER(name)