* [PATCH] mpi3mr: fix printk() format strings
@ 2023-12-07 14:28 Arnd Bergmann
2023-12-08 0:30 ` Randy Dunlap
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Arnd Bergmann @ 2023-12-07 14:28 UTC (permalink / raw)
To: Sathya Prakash Veerichetty, Kashyap Desai, Sumit Saxena,
Sreekanth Reddy, James E.J. Bottomley, Martin K. Petersen,
Chandrakanth patil
Cc: Arnd Bergmann, Ranjan Kumar, Shin'ichiro Kawasaki,
mpi3mr-linuxdrv.pdl, linux-scsi, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
The newly introduced error messages get multiple format strings wrong: size_t must
be printed using the %z modifier rather than %l and dma_addr_t must be printed
by reference using the special %pad pointer type:
drivers/scsi/mpi3mr/mpi3mr_app.c: In function 'mpi3mr_build_nvme_prp':
include/linux/kern_levels.h:5:25: error: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'dma_addr_t' {aka 'unsigned int'} [-Werror=format=]
drivers/scsi/mpi3mr/mpi3mr_app.c:949:25: note: in expansion of macro 'dprint_bsg_err'
949 | dprint_bsg_err(mrioc,
| ^~~~~~~~~~~~~~
include/linux/kern_levels.h:5:25: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
drivers/scsi/mpi3mr/mpi3mr_app.c:1112:41: note: in expansion of macro 'dprint_bsg_err'
1112 | dprint_bsg_err(mrioc,
| ^~~~~~~~~~~~~~
Fixes: 9536af615dc9 ("scsi: mpi3mr: Support for preallocation of SGL BSG data buffers part-3")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/scsi/mpi3mr/mpi3mr_app.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_app.c b/drivers/scsi/mpi3mr/mpi3mr_app.c
index 4b93b7440da6..0380996b5ad2 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_app.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_app.c
@@ -947,8 +947,8 @@ static int mpi3mr_build_nvme_prp(struct mpi3mr_ioc *mrioc,
dma_addr = drv_buf_iter->dma_desc[count].dma_addr;
if (dma_addr & page_mask) {
dprint_bsg_err(mrioc,
- "%s:dma_addr 0x%llx is not aligned with page size 0x%x\n",
- __func__, dma_addr, dev_pgsz);
+ "%s:dma_addr %pad is not aligned with page size 0x%x\n",
+ __func__, &dma_addr, dev_pgsz);
return -1;
}
}
@@ -1110,7 +1110,7 @@ static int mpi3mr_build_nvme_prp(struct mpi3mr_ioc *mrioc,
if ((++desc_count) >=
drv_buf_iter->num_dma_desc) {
dprint_bsg_err(mrioc,
- "%s: Invalid len %ld while building PRP\n",
+ "%s: Invalid len %zd while building PRP\n",
__func__, length);
goto err_out;
}
--
2.39.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] mpi3mr: fix printk() format strings
2023-12-07 14:28 [PATCH] mpi3mr: fix printk() format strings Arnd Bergmann
@ 2023-12-08 0:30 ` Randy Dunlap
2023-12-08 17:05 ` Martin K. Petersen
2023-12-19 2:18 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Randy Dunlap @ 2023-12-08 0:30 UTC (permalink / raw)
To: Arnd Bergmann, Sathya Prakash Veerichetty, Kashyap Desai,
Sumit Saxena, Sreekanth Reddy, James E.J. Bottomley,
Martin K. Petersen, Chandrakanth patil
Cc: Arnd Bergmann, Ranjan Kumar, Shin'ichiro Kawasaki,
mpi3mr-linuxdrv.pdl, linux-scsi, linux-kernel
On 12/7/23 06:28, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The newly introduced error messages get multiple format strings wrong: size_t must
> be printed using the %z modifier rather than %l and dma_addr_t must be printed
> by reference using the special %pad pointer type:
>
> drivers/scsi/mpi3mr/mpi3mr_app.c: In function 'mpi3mr_build_nvme_prp':
> include/linux/kern_levels.h:5:25: error: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'dma_addr_t' {aka 'unsigned int'} [-Werror=format=]
> drivers/scsi/mpi3mr/mpi3mr_app.c:949:25: note: in expansion of macro 'dprint_bsg_err'
> 949 | dprint_bsg_err(mrioc,
> | ^~~~~~~~~~~~~~
> include/linux/kern_levels.h:5:25: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
> drivers/scsi/mpi3mr/mpi3mr_app.c:1112:41: note: in expansion of macro 'dprint_bsg_err'
> 1112 | dprint_bsg_err(mrioc,
> | ^~~~~~~~~~~~~~
>
> Fixes: 9536af615dc9 ("scsi: mpi3mr: Support for preallocation of SGL BSG data buffers part-3")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
LGTM. Thanks.
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
> ---
> drivers/scsi/mpi3mr/mpi3mr_app.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/scsi/mpi3mr/mpi3mr_app.c b/drivers/scsi/mpi3mr/mpi3mr_app.c
> index 4b93b7440da6..0380996b5ad2 100644
> --- a/drivers/scsi/mpi3mr/mpi3mr_app.c
> +++ b/drivers/scsi/mpi3mr/mpi3mr_app.c
> @@ -947,8 +947,8 @@ static int mpi3mr_build_nvme_prp(struct mpi3mr_ioc *mrioc,
> dma_addr = drv_buf_iter->dma_desc[count].dma_addr;
> if (dma_addr & page_mask) {
> dprint_bsg_err(mrioc,
> - "%s:dma_addr 0x%llx is not aligned with page size 0x%x\n",
> - __func__, dma_addr, dev_pgsz);
> + "%s:dma_addr %pad is not aligned with page size 0x%x\n",
> + __func__, &dma_addr, dev_pgsz);
> return -1;
> }
> }
> @@ -1110,7 +1110,7 @@ static int mpi3mr_build_nvme_prp(struct mpi3mr_ioc *mrioc,
> if ((++desc_count) >=
> drv_buf_iter->num_dma_desc) {
> dprint_bsg_err(mrioc,
> - "%s: Invalid len %ld while building PRP\n",
> + "%s: Invalid len %zd while building PRP\n",
> __func__, length);
> goto err_out;
> }
--
~Randy
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] mpi3mr: fix printk() format strings
2023-12-07 14:28 [PATCH] mpi3mr: fix printk() format strings Arnd Bergmann
2023-12-08 0:30 ` Randy Dunlap
@ 2023-12-08 17:05 ` Martin K. Petersen
2023-12-19 2:18 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2023-12-08 17:05 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sathya Prakash Veerichetty, Kashyap Desai, Sumit Saxena,
Sreekanth Reddy, James E.J. Bottomley, Martin K. Petersen,
Chandrakanth patil, Arnd Bergmann, Ranjan Kumar,
Shin'ichiro Kawasaki, mpi3mr-linuxdrv.pdl, linux-scsi,
linux-kernel
Arnd,
> The newly introduced error messages get multiple format strings wrong:
> size_t must be printed using the %z modifier rather than %l and
> dma_addr_t must be printed by reference using the special %pad pointer
> type:
Applied to 6.8/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mpi3mr: fix printk() format strings
2023-12-07 14:28 [PATCH] mpi3mr: fix printk() format strings Arnd Bergmann
2023-12-08 0:30 ` Randy Dunlap
2023-12-08 17:05 ` Martin K. Petersen
@ 2023-12-19 2:18 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2023-12-19 2:18 UTC (permalink / raw)
To: Sathya Prakash Veerichetty, Kashyap Desai, Sumit Saxena,
Sreekanth Reddy, James E.J. Bottomley, Chandrakanth patil,
Arnd Bergmann
Cc: Martin K . Petersen, Arnd Bergmann, Ranjan Kumar,
Shin'ichiro Kawasaki, mpi3mr-linuxdrv.pdl, linux-scsi,
linux-kernel
On Thu, 07 Dec 2023 15:28:06 +0100, Arnd Bergmann wrote:
> The newly introduced error messages get multiple format strings wrong: size_t must
> be printed using the %z modifier rather than %l and dma_addr_t must be printed
> by reference using the special %pad pointer type:
>
> drivers/scsi/mpi3mr/mpi3mr_app.c: In function 'mpi3mr_build_nvme_prp':
> include/linux/kern_levels.h:5:25: error: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'dma_addr_t' {aka 'unsigned int'} [-Werror=format=]
> drivers/scsi/mpi3mr/mpi3mr_app.c:949:25: note: in expansion of macro 'dprint_bsg_err'
> 949 | dprint_bsg_err(mrioc,
> | ^~~~~~~~~~~~~~
> include/linux/kern_levels.h:5:25: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
> drivers/scsi/mpi3mr/mpi3mr_app.c:1112:41: note: in expansion of macro 'dprint_bsg_err'
> 1112 | dprint_bsg_err(mrioc,
> | ^~~~~~~~~~~~~~
>
> [...]
Applied to 6.8/scsi-queue, thanks!
[1/1] mpi3mr: fix printk() format strings
https://git.kernel.org/mkp/scsi/c/fc1fbd13a205
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-12-19 2:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-07 14:28 [PATCH] mpi3mr: fix printk() format strings Arnd Bergmann
2023-12-08 0:30 ` Randy Dunlap
2023-12-08 17:05 ` Martin K. Petersen
2023-12-19 2:18 ` 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