Commit 06d53789 authored by Bart Van Assche's avatar Bart Van Assche Committed by Martin K. Petersen
Browse files

scsi: scsi_transport_fc: Simplify alloc_workqueue() invocations



Let alloc_workqueue() format the workqueue name instead of calling
snprintf() explicitly.

Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20240822195944.654691-16-bvanassche@acm.org


Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 6411307b
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -441,18 +441,13 @@ static int fc_host_setup(struct transport_container *tc, struct device *dev,
	fc_host->next_vport_number = 0;
	fc_host->npiv_vports_inuse = 0;

	snprintf(fc_host->work_q_name, sizeof(fc_host->work_q_name),
		 "fc_wq_%d", shost->host_no);
	fc_host->work_q = alloc_workqueue("%s", 0, 0, fc_host->work_q_name);
	fc_host->work_q = alloc_workqueue("fc_wq_%d", 0, 0, shost->host_no);
	if (!fc_host->work_q)
		return -ENOMEM;

	fc_host->dev_loss_tmo = fc_dev_loss_tmo;
	snprintf(fc_host->devloss_work_q_name,
		 sizeof(fc_host->devloss_work_q_name),
		 "fc_dl_%d", shost->host_no);
	fc_host->devloss_work_q = alloc_workqueue("%s", 0, 0,
					fc_host->devloss_work_q_name);
	fc_host->devloss_work_q = alloc_workqueue("fc_dl_%d", 0, 0,
					shost->host_no);
	if (!fc_host->devloss_work_q) {
		destroy_workqueue(fc_host->work_q);
		fc_host->work_q = NULL;
+0 −6
Original line number Diff line number Diff line
@@ -575,9 +575,7 @@ struct fc_host_attrs {
	u16 npiv_vports_inuse;

	/* work queues for rport state manipulation */
	char work_q_name[20];
	struct workqueue_struct *work_q;
	char devloss_work_q_name[20];
	struct workqueue_struct *devloss_work_q;

	/* bsg support */
@@ -654,12 +652,8 @@ struct fc_host_attrs {
	(((struct fc_host_attrs *)(x)->shost_data)->next_vport_number)
#define fc_host_npiv_vports_inuse(x)	\
	(((struct fc_host_attrs *)(x)->shost_data)->npiv_vports_inuse)
#define fc_host_work_q_name(x) \
	(((struct fc_host_attrs *)(x)->shost_data)->work_q_name)
#define fc_host_work_q(x) \
	(((struct fc_host_attrs *)(x)->shost_data)->work_q)
#define fc_host_devloss_work_q_name(x) \
	(((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q_name)
#define fc_host_devloss_work_q(x) \
	(((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q)
#define fc_host_dev_loss_tmo(x) \