Skip to content

Commit fc1fbd1

Browse files
arndbmartinkpetersen
authored andcommitted
scsi: mpi3mr: Fix printk() format strings
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: 9536af6 ("scsi: mpi3mr: Support for preallocation of SGL BSG data buffers part-3") Signed-off-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Acked-by: Randy Dunlap <[email protected]> Tested-by: Randy Dunlap <[email protected]> # build-tested Signed-off-by: Martin K. Petersen <[email protected]>
1 parent e78e59a commit fc1fbd1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/scsi/mpi3mr/mpi3mr_app.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -947,8 +947,8 @@ static int mpi3mr_build_nvme_prp(struct mpi3mr_ioc *mrioc,
947947
dma_addr = drv_buf_iter->dma_desc[count].dma_addr;
948948
if (dma_addr & page_mask) {
949949
dprint_bsg_err(mrioc,
950-
"%s:dma_addr 0x%llx is not aligned with page size 0x%x\n",
951-
__func__, dma_addr, dev_pgsz);
950+
"%s:dma_addr %pad is not aligned with page size 0x%x\n",
951+
__func__, &dma_addr, dev_pgsz);
952952
return -1;
953953
}
954954
}
@@ -1110,7 +1110,7 @@ static int mpi3mr_build_nvme_prp(struct mpi3mr_ioc *mrioc,
11101110
if ((++desc_count) >=
11111111
drv_buf_iter->num_dma_desc) {
11121112
dprint_bsg_err(mrioc,
1113-
"%s: Invalid len %ld while building PRP\n",
1113+
"%s: Invalid len %zd while building PRP\n",
11141114
__func__, length);
11151115
goto err_out;
11161116
}

0 commit comments

Comments
 (0)