]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: core: Simplify an alloc_workqueue() invocation
authorBart Van Assche <bvanassche@acm.org>
Thu, 22 Aug 2024 19:59:22 +0000 (12:59 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 23 Aug 2024 01:28:57 +0000 (21:28 -0400)
Let alloc_workqueue() format the workqueue name. Remove the
work_q_name[] member from struct Scsi_Host because it is no longer
used by any SCSI driver nor by the SCSI core.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20240822195944.654691-19-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/hosts.c
include/scsi/scsi_host.h

index 7f987335b44c1a368b55a14efc9d7773d6cef622..e021f1106beabfd33c0d02704eb21ef793c7ebca 100644 (file)
@@ -292,11 +292,10 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
        }
 
        if (shost->transportt->create_work_queue) {
-               snprintf(shost->work_q_name, sizeof(shost->work_q_name),
-                        "scsi_wq_%d", shost->host_no);
-               shost->work_q = alloc_workqueue("%s",
-                       WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND,
-                       1, shost->work_q_name);
+               shost->work_q = alloc_workqueue(
+                       "scsi_wq_%d",
+                       WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND, 1,
+                       shost->host_no);
 
                if (!shost->work_q) {
                        error = -EINVAL;
index 19a1c5c48935348e41f5f54235ba894add0542d2..2b4ab0369ffbe9dcdb82f0d19fc7ac1e214364b8 100644 (file)
@@ -677,7 +677,6 @@ struct Scsi_Host {
        /*
         * Optional work queue to be utilized by the transport
         */
-       char work_q_name[20];
        struct workqueue_struct *work_q;
 
        /*