Skip to contentSkip to conversation

completion: Use designated initializers for struct completion

PATCH In review Thorsten Blum 2 participants 2 messages Sep 11, 2025 – Sep 18, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 completion: Use designated initializers for struct completion

Switch COMPLETION_INITIALIZER to the more modern and flexible designated initializers. This improves readability and allows struct fields to be reordered. No functional changes intended.

---
 include/linux/completion.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/completion.h +1 -1
index fb2915676574..36291cb3c0df 100644
@@ -33,7 +33,7 @@ static inline void complete_acquire(struct completion *x) {}
 static inline void complete_release(struct completion *x) {}
 
 #define COMPLETION_INITIALIZER(work) \
-	{ 0, __SWAIT_QUEUE_HEAD_INITIALIZER((work).wait) }
+	{ .done = 0, .wait = __SWAIT_QUEUE_HEAD_INITIALIZER((work).wait) }
 
 #define COMPLETION_INITIALIZER_ONSTACK_MAP(work, map) \
 	(*({ init_completion_map(&(work), &(map)); &(work); }))
Signature · 1 line
2.51.0