From: Benjamin Block Date: Wed, 7 May 2025 04:28:07 +0000 (+0200) Subject: scsi: zfcp: Simplify workqueue allocation X-Git-Tag: v6.16-rc1~116^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=769d7fbe01f65d95f4720cacb8f21e1104e61010;p=thirdparty%2Flinux.git scsi: 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. 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'. Signed-off-by: Benjamin Block Reviewed-by: Fedor Loshakov Reviewed-by: Steffen Maier Reviewed-by: M Nikhil Reviewed-by: Nihar Panda Signed-off-by: Nihar Panda Link: https://lore.kernel.org/r/20250507042854.3607038-3-niharp@linux.ibm.com Signed-off-by: Martin K. Petersen --- diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 22074e81bd383..dc2265ebb11b8 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c @@ -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)