Skip to content

Commit d77381c

Browse files
bvanasschemartinkpetersen
authored andcommitted
scsi: fcoe: Simplify alloc_ordered_workqueue() invocations
Let alloc_ordered_workqueue() format the workqueue name instead of calling snprintf() explicitly. Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 4cb1b41 commit d77381c

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

drivers/scsi/fcoe/fcoe_sysfs.c

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,8 @@ MODULE_PARM_DESC(fcf_dev_loss_tmo,
4545
*/
4646
#define fcoe_ctlr_id(x) \
4747
((x)->id)
48-
#define fcoe_ctlr_work_q_name(x) \
49-
((x)->work_q_name)
5048
#define fcoe_ctlr_work_q(x) \
5149
((x)->work_q)
52-
#define fcoe_ctlr_devloss_work_q_name(x) \
53-
((x)->devloss_work_q_name)
5450
#define fcoe_ctlr_devloss_work_q(x) \
5551
((x)->devloss_work_q)
5652
#define fcoe_ctlr_mode(x) \
@@ -797,18 +793,14 @@ struct fcoe_ctlr_device *fcoe_ctlr_device_add(struct device *parent,
797793

798794
ctlr->fcf_dev_loss_tmo = fcoe_fcf_dev_loss_tmo;
799795

800-
snprintf(ctlr->work_q_name, sizeof(ctlr->work_q_name),
801-
"ctlr_wq_%d", ctlr->id);
802-
ctlr->work_q = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM,
803-
ctlr->work_q_name);
796+
ctlr->work_q = alloc_ordered_workqueue("ctlr_wq_%d", WQ_MEM_RECLAIM,
797+
ctlr->id);
804798
if (!ctlr->work_q)
805799
goto out_del;
806800

807-
snprintf(ctlr->devloss_work_q_name,
808-
sizeof(ctlr->devloss_work_q_name),
809-
"ctlr_dl_wq_%d", ctlr->id);
810-
ctlr->devloss_work_q = alloc_ordered_workqueue(
811-
"%s", WQ_MEM_RECLAIM, ctlr->devloss_work_q_name);
801+
ctlr->devloss_work_q = alloc_ordered_workqueue("ctlr_dl_wq_%d",
802+
WQ_MEM_RECLAIM,
803+
ctlr->id);
812804
if (!ctlr->devloss_work_q)
813805
goto out_del_q;
814806

include/scsi/fcoe_sysfs.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ struct fcoe_ctlr_device {
5050
struct fcoe_sysfs_function_template *f;
5151

5252
struct list_head fcfs;
53-
char work_q_name[20];
5453
struct workqueue_struct *work_q;
55-
char devloss_work_q_name[20];
5654
struct workqueue_struct *devloss_work_q;
5755
struct mutex lock;
5856

0 commit comments

Comments
 (0)