Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Bart Van Assche and committed by
Martin K. Petersen
d77381c2 4cb1b41a

+5 -15
+5 -13
drivers/scsi/fcoe/fcoe_sysfs.c
··· 45 45 */ 46 46 #define fcoe_ctlr_id(x) \ 47 47 ((x)->id) 48 - #define fcoe_ctlr_work_q_name(x) \ 49 - ((x)->work_q_name) 50 48 #define fcoe_ctlr_work_q(x) \ 51 49 ((x)->work_q) 52 - #define fcoe_ctlr_devloss_work_q_name(x) \ 53 - ((x)->devloss_work_q_name) 54 50 #define fcoe_ctlr_devloss_work_q(x) \ 55 51 ((x)->devloss_work_q) 56 52 #define fcoe_ctlr_mode(x) \ ··· 793 797 794 798 ctlr->fcf_dev_loss_tmo = fcoe_fcf_dev_loss_tmo; 795 799 796 - snprintf(ctlr->work_q_name, sizeof(ctlr->work_q_name), 797 - "ctlr_wq_%d", ctlr->id); 798 - ctlr->work_q = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, 799 - ctlr->work_q_name); 800 + ctlr->work_q = alloc_ordered_workqueue("ctlr_wq_%d", WQ_MEM_RECLAIM, 801 + ctlr->id); 800 802 if (!ctlr->work_q) 801 803 goto out_del; 802 804 803 - snprintf(ctlr->devloss_work_q_name, 804 - sizeof(ctlr->devloss_work_q_name), 805 - "ctlr_dl_wq_%d", ctlr->id); 806 - ctlr->devloss_work_q = alloc_ordered_workqueue( 807 - "%s", WQ_MEM_RECLAIM, ctlr->devloss_work_q_name); 805 + ctlr->devloss_work_q = alloc_ordered_workqueue("ctlr_dl_wq_%d", 806 + WQ_MEM_RECLAIM, 807 + ctlr->id); 808 808 if (!ctlr->devloss_work_q) 809 809 goto out_del_q; 810 810
-2
include/scsi/fcoe_sysfs.h
··· 50 50 struct fcoe_sysfs_function_template *f; 51 51 52 52 struct list_head fcfs; 53 - char work_q_name[20]; 54 53 struct workqueue_struct *work_q; 55 - char devloss_work_q_name[20]; 56 54 struct workqueue_struct *devloss_work_q; 57 55 struct mutex lock; 58 56