Skip to content

Commit 43d5d3b

Browse files
Chaitanya Kulkarnikeithbusch
authored andcommitted
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. Signed-off-by: Chaitanya Kulkarni <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent c74649b commit 43d5d3b

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

drivers/nvme/host/core.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5009,22 +5009,20 @@ static inline void _nvme_check_size(void)
50095009

50105010
static int __init nvme_core_init(void)
50115011
{
5012+
unsigned int wq_flags = WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS;
50125013
int result = -ENOMEM;
50135014

50145015
_nvme_check_size();
50155016

5016-
nvme_wq = alloc_workqueue("nvme-wq",
5017-
WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS, 0);
5017+
nvme_wq = alloc_workqueue("nvme-wq", wq_flags, 0);
50185018
if (!nvme_wq)
50195019
goto out;
50205020

5021-
nvme_reset_wq = alloc_workqueue("nvme-reset-wq",
5022-
WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS, 0);
5021+
nvme_reset_wq = alloc_workqueue("nvme-reset-wq", wq_flags, 0);
50235022
if (!nvme_reset_wq)
50245023
goto destroy_wq;
50255024

5026-
nvme_delete_wq = alloc_workqueue("nvme-delete-wq",
5027-
WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS, 0);
5025+
nvme_delete_wq = alloc_workqueue("nvme-delete-wq", wq_flags, 0);
50285026
if (!nvme_delete_wq)
50295027
goto destroy_reset_wq;
50305028

0 commit comments

Comments
 (0)