mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-12-29 09:16:33 +00:00
scsi: fcoe: Simplify alloc_ordered_workqueue() invocations
Let alloc_ordered_workqueue() format the workqueue name instead of calling snprintf() explicitly. Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20240822195944.654691-7-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
4cb1b41a5e
commit
d77381c2f6
@ -45,12 +45,8 @@ MODULE_PARM_DESC(fcf_dev_loss_tmo,
|
||||
*/
|
||||
#define fcoe_ctlr_id(x) \
|
||||
((x)->id)
|
||||
#define fcoe_ctlr_work_q_name(x) \
|
||||
((x)->work_q_name)
|
||||
#define fcoe_ctlr_work_q(x) \
|
||||
((x)->work_q)
|
||||
#define fcoe_ctlr_devloss_work_q_name(x) \
|
||||
((x)->devloss_work_q_name)
|
||||
#define fcoe_ctlr_devloss_work_q(x) \
|
||||
((x)->devloss_work_q)
|
||||
#define fcoe_ctlr_mode(x) \
|
||||
@ -797,18 +793,14 @@ struct fcoe_ctlr_device *fcoe_ctlr_device_add(struct device *parent,
|
||||
|
||||
ctlr->fcf_dev_loss_tmo = fcoe_fcf_dev_loss_tmo;
|
||||
|
||||
snprintf(ctlr->work_q_name, sizeof(ctlr->work_q_name),
|
||||
"ctlr_wq_%d", ctlr->id);
|
||||
ctlr->work_q = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM,
|
||||
ctlr->work_q_name);
|
||||
ctlr->work_q = alloc_ordered_workqueue("ctlr_wq_%d", WQ_MEM_RECLAIM,
|
||||
ctlr->id);
|
||||
if (!ctlr->work_q)
|
||||
goto out_del;
|
||||
|
||||
snprintf(ctlr->devloss_work_q_name,
|
||||
sizeof(ctlr->devloss_work_q_name),
|
||||
"ctlr_dl_wq_%d", ctlr->id);
|
||||
ctlr->devloss_work_q = alloc_ordered_workqueue(
|
||||
"%s", WQ_MEM_RECLAIM, ctlr->devloss_work_q_name);
|
||||
ctlr->devloss_work_q = alloc_ordered_workqueue("ctlr_dl_wq_%d",
|
||||
WQ_MEM_RECLAIM,
|
||||
ctlr->id);
|
||||
if (!ctlr->devloss_work_q)
|
||||
goto out_del_q;
|
||||
|
||||
|
@ -50,9 +50,7 @@ struct fcoe_ctlr_device {
|
||||
struct fcoe_sysfs_function_template *f;
|
||||
|
||||
struct list_head fcfs;
|
||||
char work_q_name[20];
|
||||
struct workqueue_struct *work_q;
|
||||
char devloss_work_q_name[20];
|
||||
struct workqueue_struct *devloss_work_q;
|
||||
struct mutex lock;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user