zfcp: simplify workqueue allocation
Subsystems (3)
Nihar Panda
maintainerHello James, Martin,
we have a small zfcp bugfix.
It would be nice, if you could still include them v6.15-rc5 merge window
Nihar Panda
maintainercover zfcp: simplify workqueue allocation
alloc_ordered_workqueue() accepts a format string and format arguments as part of the call, so there is no need for the indirection of first using snprintf() to print the name into an local array, and then passing that array to the allocation call.
Benjamin Block (1):
zfcp: simplify workqueue allocation
drivers/s390/scsi/zfcp_aux.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
base-commit: 20b97acc4cafa2be8ac91a777de135110e58a90b
Signature · 1 line
2.45.2
Nihar Panda
maintainerPATCH 1/1 zfcp: simplify workqueue allocation
In reply to Nihar PandaFrom: Benjamin Block <[email protected]>
alloc_ordered_workqueue() accepts a format string and format arguments as part of the call, so there is no need for the indirection of first using snprintf() to print the name into an local array, and then passing that array to the allocation call.
Also make the error-/non-error-case handling more canonical in that the error case is tested in the if that follows the allocation call, and the default return value of the function is 0.
--- drivers/s390/scsi/zfcp_aux.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
drivers/s390/scsi/zfcp_aux.c +6 -8
@@ -312,15 +312,13 @@ static void zfcp_print_sl(struct seq_file *m, struct service_level *sl)static int zfcp_setup_adapter_work_queue (struct zfcp_adapter *adapter) { -char name[TASK_COMM_LEN ]; - -snprintf (name,sizeof (name),"zfcp_q_%s" , -dev_name (&adapter->ccw_device->dev)); - adapter->work_queue =alloc_ordered_workqueue (name,WQ_MEM_RECLAIM ); + adapter->work_queue = +alloc_ordered_workqueue ("zfcp_q_%s" ,WQ_MEM_RECLAIM , +dev_name (&adapter->ccw_device->dev)); +if (!adapter->work_queue) +return -ENOMEM ; -if (adapter->work_queue) -return 0 ; -return -ENOMEM ; +return 0 ; }static void zfcp_destroy_adapter_work_queue (struct zfcp_adapter *adapter)
base-commit: e142de4aac2aae697d7e977b01e7a889e9f454df
Signature · 1 line
2.45.2
Martin K. Petersen
AppliedNihar,
Quoted 4 lines
alloc_ordered_workqueue()accepts a format string and format arguments as part of the call, so there is no need for the indirection of first usingsnprintf()to print the name into an local array, and then passing that array to the allocation call.
Applied to 6.16/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen
Martin K. Petersen
AppliedQuoted 10 lines · Nihar Panda
alloc_ordered_workqueue()accepts a format string and format arguments as part of the call, so there is no need for the indirection of first usingsnprintf()to print the name into an local array, and then passing that array to the allocation call.Also make the error-/non-error-case handling more canonical in that the error case is tested in the
ifthat follows the allocation call, and the default return value of the function is0.[...]
Applied to 6.16/scsi-queue, thanks!
[1/1] zfcp: simplify workqueue allocation
https://git.kernel.org/mkp/scsi/c/769d7fbe01f6
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering