mpi3mr: fix printk() format strings
Subsystems (2)
PATCH 1/1 mpi3mr: fix printk() format strings
From: Arnd Bergmann <[email protected]>
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,
| ^~~~~~~~~~~~~~--- drivers/scsi/mpi3mr/mpi3mr_app.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/mpi3mr/mpi3mr_app.c +3 -3
@@ -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; }
Signature · 1 line
2.39.2
Quoted 16 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The newly introduced error messages get multiple format strings wrong:
size_tmust be printed using the %z modifier rather than %l anddma_addr_tmust 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, | ^~~~~~~~~~~~~~
Quoted 2 lines
Fixes 9536af615dc9 ("scsi: mpi3mr: Support for preallocation of SGL BSG data buffers part-3")Signed-off-by Arnd Bergmann <[email protected]>
LGTM. Thanks.
Quoted 28 lines
--- drivers/scsi/mpi3mr/mpi3mr_app.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/scsi/mpi3mr/mpi3mr_app.c +3
-3@@ -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; }
Signature · 1 line
~Randy
Martin K. Petersen
AppliedArnd,
Quoted 4 lines
The newly introduced error messages get multiple format strings wrong:
size_tmust be printed using the %z modifier rather than %l anddma_addr_tmust be printed by reference using the special %pad pointer type:
Applied to 6.8/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Martin K. Petersen
AppliedQuoted 7 lines · Arnd Bergmann
The newly introduced error messages get multiple format strings wrong:
size_tmust be printed using the %z modifier rather than %l anddma_addr_tmust 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'
Quoted 8 lines
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
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering