[PATCH 33/53] scsi: libsas: Simplify the create*_workqueue() calls
From: Bart Van Assche
Date: Sun Jun 30 2024 - 18:37:16 EST
Pass a format string to create*_workqueue2() instead of formatting the
workqueue name before create*_workqueue() is called.
Cc: Martin K. Petersen <martin.petersen@xxxxxxxxxx>
Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
---
drivers/scsi/libsas/sas_init.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/scsi/libsas/sas_init.c b/drivers/scsi/libsas/sas_init.c
index 9c8cc723170d..e7d2edf9e635 100644
--- a/drivers/scsi/libsas/sas_init.c
+++ b/drivers/scsi/libsas/sas_init.c
@@ -92,7 +92,6 @@ void sas_hash_addr(u8 *hashed, const u8 *sas_addr)
int sas_register_ha(struct sas_ha_struct *sas_ha)
{
- char name[64];
int error = 0;
mutex_init(&sas_ha->disco_mutex);
@@ -121,13 +120,13 @@ int sas_register_ha(struct sas_ha_struct *sas_ha)
}
error = -ENOMEM;
- snprintf(name, sizeof(name), "%s_event_q", dev_name(sas_ha->dev));
- sas_ha->event_q = create_singlethread_workqueue(name);
+ sas_ha->event_q = create_singlethread_workqueue2("%s_event_q",
+ dev_name(sas_ha->dev));
if (!sas_ha->event_q)
goto Undo_ports;
- snprintf(name, sizeof(name), "%s_disco_q", dev_name(sas_ha->dev));
- sas_ha->disco_q = create_singlethread_workqueue(name);
+ sas_ha->disco_q = create_singlethread_workqueue2("%s_disco_q",
+ dev_name(sas_ha->dev));
if (!sas_ha->disco_q)
goto Undo_event_q;