Skip to contentSkip to conversation

nvme-core: remove repeated wq flags

PATCH Applied Chaitanya Kulkarni 4 participants 5 messages Oct 30, 2024 – Nov 5, 2024 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme-core: remove repeated wq flags

In nvme_core_init() nvme_wq, nvme_reset_wq, nvme_delete_wq share same flags :- WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS.

Insated of repeating these flags in each call use the common variable.

---
 drivers/nvme/host/core.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/nvme/host/core.c +4 -6
index 84cb859a911d..e9aac07f4c26 100644
@@ -5009,22 +5009,20 @@ static inline void _nvme_check_size(void)
 
 static int __init nvme_core_init(void)
 {
+	unsigned int wq_flags = WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS;
 	int result = -ENOMEM;
 
 	_nvme_check_size();
 
-	nvme_wq = alloc_workqueue("nvme-wq",
-			WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS, 0);
+	nvme_wq = alloc_workqueue("nvme-wq", wq_flags, 0);
 	if (!nvme_wq)
 		goto out;
 
-	nvme_reset_wq = alloc_workqueue("nvme-reset-wq",
-			WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS, 0);
+	nvme_reset_wq = alloc_workqueue("nvme-reset-wq", wq_flags, 0);
 	if (!nvme_reset_wq)
 		goto destroy_wq;
 
-	nvme_delete_wq = alloc_workqueue("nvme-delete-wq",
-			WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS, 0);
+	nvme_delete_wq = alloc_workqueue("nvme-delete-wq", wq_flags, 0);
 	if (!nvme_delete_wq)
 		goto destroy_reset_wq;
 
Signature · 1 line
2.40.0
#1 lore raw

Looks fine, let's hope the flags actually stay the same in the long run :)

#2 lore raw
Quoted 2 lines · Christoph Hellwig

Looks fine, let's hope the flags actually stay the same in the long run :)

Yeah, it will be nice to get rb tag ...

-ck

maintainer Applied
#4 lore raw
In reply to Chaitanya Kulkarni
Quoted 4 lines · Chaitanya Kulkarni

In nvme_core_init() nvme_wq, nvme_reset_wq, nvme_delete_wq share same flags :- WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS.

Insated of repeating these flags in each call use the common variable.

Thanks, applied to nvme-6.13.