Skip to content

Commit 9f365cb

Browse files
nathanchancemartinkpetersen
authored andcommitted
scsi: mpi3mr: Use proper format specifier in mpi3mr_sas_port_add()
When building for a 32-bit platform such as ARM or i386, for which size_t is unsigned int, there is a warning due to using an unsigned long format specifier: drivers/scsi/mpi3mr/mpi3mr_transport.c:1370:11: error: format specifies type 'unsigned long' but the argument has type 'unsigned int' [-Werror,-Wformat] 1369 | ioc_warn(mrioc, "skipping port %u, max allowed value is %lu\n", | ~~~ | %u 1370 | i, sizeof(mr_sas_port->phy_mask) * 8); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Use the proper format specifier for size_t, %zu, to resolve the warning for all platforms. Fixes: 3668651 ("scsi: mpi3mr: Sanitise num_phys") Signed-off-by: Nathan Chancellor <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 3668651 commit 9f365cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/mpi3mr/mpi3mr_transport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1366,7 +1366,7 @@ static struct mpi3mr_sas_port *mpi3mr_sas_port_add(struct mpi3mr_ioc *mrioc,
13661366
continue;
13671367

13681368
if (i > sizeof(mr_sas_port->phy_mask) * 8) {
1369-
ioc_warn(mrioc, "skipping port %u, max allowed value is %lu\n",
1369+
ioc_warn(mrioc, "skipping port %u, max allowed value is %zu\n",
13701370
i, sizeof(mr_sas_port->phy_mask) * 8);
13711371
goto out_fail;
13721372
}

0 commit comments

Comments
 (0)