* zfcp: simplify workqueue allocation
@ 2025-05-07 4:28 Nihar Panda
2025-05-07 4:28 ` [PATCH 0/1] " Nihar Panda
2025-05-07 4:28 ` [PATCH] " Nihar Panda
0 siblings, 2 replies; 5+ messages in thread
From: Nihar Panda @ 2025-05-07 4:28 UTC (permalink / raw)
To: James E . J . Bottomley, Martin K . Petersen
Cc: linux-scsi, linux-s390, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger
Hello James, Martin,
we have a small zfcp bugfix.
It would be nice, if you could still include them v6.15-rc5 merge window
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 0/1] zfcp: simplify workqueue allocation
2025-05-07 4:28 zfcp: simplify workqueue allocation Nihar Panda
@ 2025-05-07 4:28 ` Nihar Panda
2025-05-07 4:28 ` [PATCH] " Nihar Panda
1 sibling, 0 replies; 5+ messages in thread
From: Nihar Panda @ 2025-05-07 4:28 UTC (permalink / raw)
To: James E . J . Bottomley, Martin K . Petersen
Cc: linux-scsi, linux-s390, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger
`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
--
2.45.2
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] zfcp: simplify workqueue allocation
2025-05-07 4:28 zfcp: simplify workqueue allocation Nihar Panda
2025-05-07 4:28 ` [PATCH 0/1] " Nihar Panda
@ 2025-05-07 4:28 ` Nihar Panda
2025-05-13 2:26 ` Martin K. Petersen
2025-05-21 2:19 ` Martin K. Petersen
1 sibling, 2 replies; 5+ messages in thread
From: Nihar Panda @ 2025-05-07 4:28 UTC (permalink / raw)
To: James E . J . Bottomley, Martin K . Petersen
Cc: linux-scsi, linux-s390, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger
From: Benjamin Block <bblock@linux.ibm.com>
`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 <bblock@linux.ibm.com>
Reviewed-by: Fedor Loshakov <loshakov@linux.ibm.com>
Reviewed-by: Steffen Maier <maier@linux.ibm.com>
Reviewed-by: M Nikhil <nikh1092@linux.ibm.com>
Reviewed-by: Nihar Panda <niharp@linux.ibm.com>
Signed-off-by: Nihar Panda <niharp@linux.ibm.com>
---
drivers/s390/scsi/zfcp_aux.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index 22074e81bd38..dc2265ebb11b 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)
base-commit: e142de4aac2aae697d7e977b01e7a889e9f454df
--
2.45.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] zfcp: simplify workqueue allocation
2025-05-07 4:28 ` [PATCH] " Nihar Panda
@ 2025-05-13 2:26 ` Martin K. Petersen
2025-05-21 2:19 ` Martin K. Petersen
1 sibling, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2025-05-13 2:26 UTC (permalink / raw)
To: Nihar Panda
Cc: James E . J . Bottomley, Martin K . Petersen, linux-scsi,
linux-s390, Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
Christian Borntraeger
Nihar,
> `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.
Applied to 6.16/scsi-staging, thanks!
--
Martin K. Petersen
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] zfcp: simplify workqueue allocation
2025-05-07 4:28 ` [PATCH] " Nihar Panda
2025-05-13 2:26 ` Martin K. Petersen
@ 2025-05-21 2:19 ` Martin K. Petersen
1 sibling, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2025-05-21 2:19 UTC (permalink / raw)
To: James E . J . Bottomley, Nihar Panda
Cc: Martin K . Petersen, linux-scsi, linux-s390, Heiko Carstens,
Vasily Gorbik, Alexander Gordeev, Christian Borntraeger
On Wed, 07 May 2025 06:28:07 +0200, Nihar Panda wrote:
> `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`.
>
> [...]
Applied to 6.16/scsi-queue, thanks!
[1/1] zfcp: simplify workqueue allocation
https://git.kernel.org/mkp/scsi/c/769d7fbe01f6
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-05-21 2:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-07 4:28 zfcp: simplify workqueue allocation Nihar Panda
2025-05-07 4:28 ` [PATCH 0/1] " Nihar Panda
2025-05-07 4:28 ` [PATCH] " Nihar Panda
2025-05-13 2:26 ` Martin K. Petersen
2025-05-21 2:19 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).