[PATCH 33/53] scsi: libsas: Simplify the create*_workqueue() calls

Bart Van Assche posted 53 patches 1 year, 5 months ago
Only 52 patches received!
[PATCH 33/53] scsi: libsas: Simplify the create*_workqueue() calls
Posted by Bart Van Assche 1 year, 5 months ago
Pass a format string to create*_workqueue2() instead of formatting the
workqueue name before create*_workqueue() is called.

Cc: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 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;
 
Re: [PATCH 33/53] scsi: libsas: Simplify the create*_workqueue() calls
Posted by Jason Yan 1 year, 5 months ago
Bart Van Assche 於 2024/7/1 6:26 寫道:
> Pass a format string to create*_workqueue2() instead of formatting the
> workqueue name before create*_workqueue() is called.
> 
> Cc: Martin K. Petersen <martin.petersen@oracle.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
>   drivers/scsi/libsas/sas_init.c | 9 ++++-----
>   1 file changed, 4 insertions(+), 5 deletions(-)

Reviewed-by: Jason Yan <yanaijie@huawei.com>

祝一切顺利
Re: [PATCH 33/53] scsi: libsas: Simplify the create*_workqueue() calls
Posted by Damien Le Moal 1 year, 5 months ago
On 7/1/24 07:26, Bart Van Assche wrote:
> Pass a format string to create*_workqueue2() instead of formatting the
> workqueue name before create*_workqueue() is called.
> 
> Cc: Martin K. Petersen <martin.petersen@oracle.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>

Looks good.

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>

-- 
Damien Le Moal
Western Digital Research