public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: "Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, Bart Van Assche <bvanassche@acm.org>,
	Hannes Reinecke <hare@suse.de>,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Subject: [PATCH v2 06/18] scsi: fcoe: Simplify alloc_ordered_workqueue() invocations
Date: Fri, 16 Aug 2024 14:55:29 -0700	[thread overview]
Message-ID: <20240816215605.36240-7-bvanassche@acm.org> (raw)
In-Reply-To: <20240816215605.36240-1-bvanassche@acm.org>

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>
---
 drivers/scsi/fcoe/fcoe_sysfs.c | 18 +++++-------------
 include/scsi/fcoe_sysfs.h      |  2 --
 2 files changed, 5 insertions(+), 15 deletions(-)

diff --git a/drivers/scsi/fcoe/fcoe_sysfs.c b/drivers/scsi/fcoe/fcoe_sysfs.c
index 06357bbf6b2c..0609ca6b9353 100644
--- a/drivers/scsi/fcoe/fcoe_sysfs.c
+++ b/drivers/scsi/fcoe/fcoe_sysfs.c
@@ -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;
 
diff --git a/include/scsi/fcoe_sysfs.h b/include/scsi/fcoe_sysfs.h
index 4b1216de3f22..2b28a05e492b 100644
--- a/include/scsi/fcoe_sysfs.h
+++ b/include/scsi/fcoe_sysfs.h
@@ -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;
 

  parent reply	other threads:[~2024-08-16 21:56 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-16 21:55 [PATCH v2 00/18] Simplify multiple create*_workqueue() invocations Bart Van Assche
2024-08-16 21:55 ` [PATCH v2 01/18] scsi: Expand all " Bart Van Assche
2024-08-18 23:25   ` Damien Le Moal
2024-08-19 17:17     ` Bart Van Assche
2024-08-19 23:15       ` Damien Le Moal
2024-08-20  5:59   ` Peter Wang (王信友)
2024-08-16 21:55 ` [PATCH v2 02/18] scsi: mptfusion: Simplify the alloc*_workqueue() invocations Bart Van Assche
2024-08-18 23:51   ` Damien Le Moal
2024-08-19 17:08     ` Bart Van Assche
2024-08-19 23:05       ` Damien Le Moal
2024-08-16 21:55 ` [PATCH v2 03/18] scsi: be2iscsi: Simplify an alloc_workqueue() invocation Bart Van Assche
2024-08-16 21:55 ` [PATCH v2 04/18] scsi: bfa: Simplify an alloc_ordered_workqueue() invocation Bart Van Assche
2024-08-16 21:55 ` [PATCH v2 05/18] scsi: esas2r: " Bart Van Assche
2024-08-16 21:55 ` Bart Van Assche [this message]
2024-08-16 21:55 ` [PATCH v2 07/18] scsi: ibmvscsi_tgt: Simplify an alloc_workqueue() invocation Bart Van Assche
2024-08-16 21:55 ` [PATCH v2 08/18] scsi: mpi3mr: Simplify an alloc_ordered_workqueue() invocation Bart Van Assche
2024-08-16 21:55 ` [PATCH v2 09/18] scsi: mpt3sas: " Bart Van Assche
2024-08-16 21:55 ` [PATCH v2 10/18] scsi: myrb: " Bart Van Assche
2024-08-16 21:55 ` [PATCH v2 11/18] scsi: myrs: " Bart Van Assche
2024-08-16 21:55 ` [PATCH v2 12/18] scsi: qedf: Simplify alloc_workqueue() invocations Bart Van Assche
2024-08-16 21:55 ` [PATCH v2 13/18] scsi: qedi: Simplify an alloc_workqueue() invocation Bart Van Assche
2024-08-16 21:55 ` [PATCH v2 14/18] scsi: snic: Simplify alloc_workqueue() invocations Bart Van Assche
2024-08-16 21:55 ` [PATCH v2 15/18] scsi: scsi_transport_fc: " Bart Van Assche
2024-08-16 21:55 ` [PATCH v2 16/18] scsi: stex: Simplify an alloc_ordered_workqueue() invocation Bart Van Assche
2024-08-16 21:55 ` [PATCH v2 17/18] scsi: ufs: Simplify alloc*_workqueue() invocation Bart Van Assche
2024-08-17  1:53   ` Manivannan Sadhasivam
2024-08-20  6:00   ` Peter Wang (王信友)
2024-08-16 21:55 ` [PATCH v2 18/18] scsi: core: Simplify an alloc_workqueue() invocation Bart Van Assche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240816215605.36240-7-bvanassche@acm.org \
    --to=bvanassche@acm.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=hare@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox