diff options
| author | Nathan Chancellor <nathan@kernel.org> | 2024-05-14 13:47:23 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-07-11 12:49:15 +0200 |
| commit | 155d9c9ed1292b5957d9b71a041957d63ea25ebc (patch) | |
| tree | d9fdadc287585f08bb0087f659b7ba26dd2147d8 /drivers/scsi | |
| parent | 72aa369e4e624b6d4e92ec236f8bbf92d86fb903 (diff) | |
| download | linux-155d9c9ed1292b5957d9b71a041957d63ea25ebc.tar.gz linux-155d9c9ed1292b5957d9b71a041957d63ea25ebc.tar.bz2 linux-155d9c9ed1292b5957d9b71a041957d63ea25ebc.zip | |
scsi: mpi3mr: Use proper format specifier in mpi3mr_sas_port_add()
commit 9f365cb8bbd0162963d6852651d7c9e30adcb7b5 upstream.
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: 3668651def2c ("scsi: mpi3mr: Sanitise num_phys")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20240514-mpi3mr-fix-wformat-v1-1-f1ad49217e5e@kernel.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/scsi')
| -rw-r--r-- | drivers/scsi/mpi3mr/mpi3mr_transport.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/mpi3mr/mpi3mr_transport.c b/drivers/scsi/mpi3mr/mpi3mr_transport.c index 91c2f667a4c0..0072bbdb265b 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_transport.c +++ b/drivers/scsi/mpi3mr/mpi3mr_transport.c @@ -1366,7 +1366,7 @@ static struct mpi3mr_sas_port *mpi3mr_sas_port_add(struct mpi3mr_ioc *mrioc, continue; if (i > sizeof(mr_sas_port->phy_mask) * 8) { - ioc_warn(mrioc, "skipping port %u, max allowed value is %lu\n", + ioc_warn(mrioc, "skipping port %u, max allowed value is %zu\n", i, sizeof(mr_sas_port->phy_mask) * 8); goto out_fail; } |
