Skip to content

Commit ba52850

Browse files
bvanasschemartinkpetersen
authored andcommitted
scsi: core: Simplify an alloc_workqueue() invocation
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 1aa992c commit ba52850

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

drivers/scsi/hosts.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,10 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
292292
}
293293

294294
if (shost->transportt->create_work_queue) {
295-
snprintf(shost->work_q_name, sizeof(shost->work_q_name),
296-
"scsi_wq_%d", shost->host_no);
297-
shost->work_q = alloc_workqueue("%s",
298-
WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND,
299-
1, shost->work_q_name);
295+
shost->work_q = alloc_workqueue(
296+
"scsi_wq_%d",
297+
WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND, 1,
298+
shost->host_no);
300299

301300
if (!shost->work_q) {
302301
error = -EINVAL;

include/scsi/scsi_host.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,6 @@ struct Scsi_Host {
677677
/*
678678
* Optional work queue to be utilized by the transport
679679
*/
680-
char work_q_name[20];
681680
struct workqueue_struct *work_q;
682681

683682
/*

0 commit comments

Comments
 (0)