* [PATCH] qla2xxx: fix printk format string
@ 2023-01-17 17:00 Arnd Bergmann
2023-01-17 17:39 ` Bart Van Assche
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Arnd Bergmann @ 2023-01-17 17:00 UTC (permalink / raw)
To: Nilesh Javali, GR-QLogic-Storage-Upstream, James E.J. Bottomley,
Martin K. Petersen, Himanshu Madhani, Quinn Tran
Cc: Arnd Bergmann, Saurav Kashyap, Tom Rix, linux-scsi, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
Printing a size_t value that is the result of the sizeof() operator requires
using the %z format string modifier to avoid a warning on 32-bit architectures:
drivers/scsi/qla2xxx/qla_mid.c: In function 'qla_create_buf_pool':
drivers/scsi/qla2xxx/qla_mid.c:1094:51: error: format '%ld' expects argument of type 'long int', but argument 5 has type 'unsigned int' [-Werror=format=]
1094 | "Failed to allocate buf_map(%ld).\n", sz * sizeof(unsigned long));
| ~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| long int unsigned int
| %d
Fixes: 82d8dfd2a238 ("scsi: qla2xxx: edif: Fix performance dip due to lock contention")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/scsi/qla2xxx/qla_mid.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c
index c6ca39b8e23d..1483f6258f92 100644
--- a/drivers/scsi/qla2xxx/qla_mid.c
+++ b/drivers/scsi/qla2xxx/qla_mid.c
@@ -1091,7 +1091,7 @@ int qla_create_buf_pool(struct scsi_qla_host *vha, struct qla_qpair *qp)
qp->buf_pool.buf_map = kcalloc(sz, sizeof(long), GFP_KERNEL);
if (!qp->buf_pool.buf_map) {
ql_log(ql_log_warn, vha, 0x0186,
- "Failed to allocate buf_map(%ld).\n", sz * sizeof(unsigned long));
+ "Failed to allocate buf_map(%zd).\n", sz * sizeof(unsigned long));
return -ENOMEM;
}
sz = qp->req->length * sizeof(void *);
--
2.39.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] qla2xxx: fix printk format string
2023-01-17 17:00 [PATCH] qla2xxx: fix printk format string Arnd Bergmann
@ 2023-01-17 17:39 ` Bart Van Assche
2023-01-17 18:06 ` Himanshu Madhani
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Bart Van Assche @ 2023-01-17 17:39 UTC (permalink / raw)
To: Arnd Bergmann, Nilesh Javali, GR-QLogic-Storage-Upstream,
James E.J. Bottomley, Martin K. Petersen, Himanshu Madhani,
Quinn Tran
Cc: Arnd Bergmann, Saurav Kashyap, Tom Rix, linux-scsi, linux-kernel
On 1/17/23 09:00, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> Printing a size_t value that is the result of the sizeof() operator requires
> using the %z format string modifier to avoid a warning on 32-bit architectures:
>
> drivers/scsi/qla2xxx/qla_mid.c: In function 'qla_create_buf_pool':
> drivers/scsi/qla2xxx/qla_mid.c:1094:51: error: format '%ld' expects argument of type 'long int', but argument 5 has type 'unsigned int' [-Werror=format=]
> 1094 | "Failed to allocate buf_map(%ld).\n", sz * sizeof(unsigned long));
> | ~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
> | | |
> | long int unsigned int
> | %d
>
> Fixes: 82d8dfd2a238 ("scsi: qla2xxx: edif: Fix performance dip due to lock contention")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/scsi/qla2xxx/qla_mid.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c
> index c6ca39b8e23d..1483f6258f92 100644
> --- a/drivers/scsi/qla2xxx/qla_mid.c
> +++ b/drivers/scsi/qla2xxx/qla_mid.c
> @@ -1091,7 +1091,7 @@ int qla_create_buf_pool(struct scsi_qla_host *vha, struct qla_qpair *qp)
> qp->buf_pool.buf_map = kcalloc(sz, sizeof(long), GFP_KERNEL);
> if (!qp->buf_pool.buf_map) {
> ql_log(ql_log_warn, vha, 0x0186,
> - "Failed to allocate buf_map(%ld).\n", sz * sizeof(unsigned long));
> + "Failed to allocate buf_map(%zd).\n", sz * sizeof(unsigned long));
> return -ENOMEM;
> }
> sz = qp->req->length * sizeof(void *);
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] qla2xxx: fix printk format string
2023-01-17 17:00 [PATCH] qla2xxx: fix printk format string Arnd Bergmann
2023-01-17 17:39 ` Bart Van Assche
@ 2023-01-17 18:06 ` Himanshu Madhani
2023-01-17 19:29 ` Nick Desaulniers
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Himanshu Madhani @ 2023-01-17 18:06 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Nilesh Javali, GR-QLogic-Storage-Upstream, James E.J. Bottomley,
Martin Petersen, Quinn Tran, Arnd Bergmann, Saurav Kashyap,
Tom Rix, linux-scsi, linux-kernel
> On Jan 17, 2023, at 9:00 AM, Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> Printing a size_t value that is the result of the sizeof() operator requires
> using the %z format string modifier to avoid a warning on 32-bit architectures:
>
> drivers/scsi/qla2xxx/qla_mid.c: In function 'qla_create_buf_pool':
> drivers/scsi/qla2xxx/qla_mid.c:1094:51: error: format '%ld' expects argument of type 'long int', but argument 5 has type 'unsigned int' [-Werror=format=]
> 1094 | "Failed to allocate buf_map(%ld).\n", sz * sizeof(unsigned long));
> | ~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
> | | |
> | long int unsigned int
> | %d
>
> Fixes: 82d8dfd2a238 ("scsi: qla2xxx: edif: Fix performance dip due to lock contention")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/scsi/qla2xxx/qla_mid.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c
> index c6ca39b8e23d..1483f6258f92 100644
> --- a/drivers/scsi/qla2xxx/qla_mid.c
> +++ b/drivers/scsi/qla2xxx/qla_mid.c
> @@ -1091,7 +1091,7 @@ int qla_create_buf_pool(struct scsi_qla_host *vha, struct qla_qpair *qp)
> qp->buf_pool.buf_map = kcalloc(sz, sizeof(long), GFP_KERNEL);
> if (!qp->buf_pool.buf_map) {
> ql_log(ql_log_warn, vha, 0x0186,
> - "Failed to allocate buf_map(%ld).\n", sz * sizeof(unsigned long));
> + "Failed to allocate buf_map(%zd).\n", sz * sizeof(unsigned long));
> return -ENOMEM;
> }
> sz = qp->req->length * sizeof(void *);
> --
> 2.39.0
>
Reviewed-by: Himanshu Madhani <himansnhu.madhani@oracle.com <mailto:himansnhu.madhani@oracle.com>>
--
Himanshu Madhani Oracle Linux Engineering
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] qla2xxx: fix printk format string
2023-01-17 17:00 [PATCH] qla2xxx: fix printk format string Arnd Bergmann
2023-01-17 17:39 ` Bart Van Assche
2023-01-17 18:06 ` Himanshu Madhani
@ 2023-01-17 19:29 ` Nick Desaulniers
2023-01-18 23:35 ` Martin K. Petersen
2023-01-27 3:22 ` Martin K. Petersen
4 siblings, 0 replies; 6+ messages in thread
From: Nick Desaulniers @ 2023-01-17 19:29 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Nilesh Javali, GR-QLogic-Storage-Upstream, James E.J. Bottomley,
Martin K. Petersen, Himanshu Madhani, Quinn Tran, Arnd Bergmann,
Saurav Kashyap, Tom Rix, linux-scsi, linux-kernel, llvm
On Tue, Jan 17, 2023 at 06:00:15PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> Printing a size_t value that is the result of the sizeof() operator requires
> using the %z format string modifier to avoid a warning on 32-bit architectures:
>
> drivers/scsi/qla2xxx/qla_mid.c: In function 'qla_create_buf_pool':
> drivers/scsi/qla2xxx/qla_mid.c:1094:51: error: format '%ld' expects argument of type 'long int', but argument 5 has type 'unsigned int' [-Werror=format=]
> 1094 | "Failed to allocate buf_map(%ld).\n", sz * sizeof(unsigned long));
> | ~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
> | | |
> | long int unsigned int
> | %d
>
> Fixes: 82d8dfd2a238 ("scsi: qla2xxx: edif: Fix performance dip due to lock contention")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Thanks for the patch!
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reported-by: "kernelci.org bot" <bot@kernelci.org>
Link: https://lore.kernel.org/llvm/63c4ddba.170a0220.1547e.db75@mx.google.com/
> ---
> drivers/scsi/qla2xxx/qla_mid.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c
> index c6ca39b8e23d..1483f6258f92 100644
> --- a/drivers/scsi/qla2xxx/qla_mid.c
> +++ b/drivers/scsi/qla2xxx/qla_mid.c
> @@ -1091,7 +1091,7 @@ int qla_create_buf_pool(struct scsi_qla_host *vha, struct qla_qpair *qp)
> qp->buf_pool.buf_map = kcalloc(sz, sizeof(long), GFP_KERNEL);
> if (!qp->buf_pool.buf_map) {
> ql_log(ql_log_warn, vha, 0x0186,
> - "Failed to allocate buf_map(%ld).\n", sz * sizeof(unsigned long));
> + "Failed to allocate buf_map(%zd).\n", sz * sizeof(unsigned long));
> return -ENOMEM;
> }
> sz = qp->req->length * sizeof(void *);
> --
> 2.39.0
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] qla2xxx: fix printk format string
2023-01-17 17:00 [PATCH] qla2xxx: fix printk format string Arnd Bergmann
` (2 preceding siblings ...)
2023-01-17 19:29 ` Nick Desaulniers
@ 2023-01-18 23:35 ` Martin K. Petersen
2023-01-27 3:22 ` Martin K. Petersen
4 siblings, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2023-01-18 23:35 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Nilesh Javali, GR-QLogic-Storage-Upstream, James E.J. Bottomley,
Martin K. Petersen, Himanshu Madhani, Quinn Tran, Arnd Bergmann,
Saurav Kashyap, Tom Rix, linux-scsi, linux-kernel
Arnd,
> Printing a size_t value that is the result of the sizeof() operator
> requires using the %z format string modifier to avoid a warning on
> 32-bit architectures:
Applied to 6.3/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] qla2xxx: fix printk format string
2023-01-17 17:00 [PATCH] qla2xxx: fix printk format string Arnd Bergmann
` (3 preceding siblings ...)
2023-01-18 23:35 ` Martin K. Petersen
@ 2023-01-27 3:22 ` Martin K. Petersen
4 siblings, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2023-01-27 3:22 UTC (permalink / raw)
To: Nilesh Javali, GR-QLogic-Storage-Upstream, James E.J. Bottomley,
Himanshu Madhani, Quinn Tran, Arnd Bergmann
Cc: Martin K . Petersen, Arnd Bergmann, Saurav Kashyap, Tom Rix,
linux-scsi, linux-kernel
On Tue, 17 Jan 2023 18:00:15 +0100, Arnd Bergmann wrote:
> Printing a size_t value that is the result of the sizeof() operator requires
> using the %z format string modifier to avoid a warning on 32-bit architectures:
>
> drivers/scsi/qla2xxx/qla_mid.c: In function 'qla_create_buf_pool':
> drivers/scsi/qla2xxx/qla_mid.c:1094:51: error: format '%ld' expects argument of type 'long int', but argument 5 has type 'unsigned int' [-Werror=format=]
> 1094 | "Failed to allocate buf_map(%ld).\n", sz * sizeof(unsigned long));
> | ~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
> | | |
> | long int unsigned int
> | %d
>
> [...]
Applied to 6.3/scsi-queue, thanks!
[1/1] qla2xxx: fix printk format string
https://git.kernel.org/mkp/scsi/c/d794a23113b1
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-01-27 3:23 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-17 17:00 [PATCH] qla2xxx: fix printk format string Arnd Bergmann
2023-01-17 17:39 ` Bart Van Assche
2023-01-17 18:06 ` Himanshu Madhani
2023-01-17 19:29 ` Nick Desaulniers
2023-01-18 23:35 ` Martin K. Petersen
2023-01-27 3:22 ` Martin K. Petersen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.