* [PATCH] scsi: mpi3mr: Use proper format specifier in mpi3mr_sas_port_add()
@ 2024-05-14 20:47 Nathan Chancellor
2024-05-15 13:42 ` Martin K. Petersen
2024-05-21 2:40 ` Martin K. Petersen
0 siblings, 2 replies; 4+ messages in thread
From: Nathan Chancellor @ 2024-05-14 20:47 UTC (permalink / raw)
To: Sathya Prakash Veerichetty, Kashyap Desai, Sumit Saxena,
Sreekanth Reddy, James E.J. Bottomley, Martin K. Petersen,
Tomas Henzl
Cc: mpi3mr-linuxdrv.pdl, linux-scsi, patches, Nathan Chancellor
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>
---
drivers/scsi/mpi3mr/mpi3mr_transport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_transport.c b/drivers/scsi/mpi3mr/mpi3mr_transport.c
index 7ca9a7c2709c..5d261c2f2d20 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;
}
---
base-commit: 3668651def2c1622904e58b0280ee93121f2b10b
change-id: 20240514-mpi3mr-fix-wformat-8d81db9873e3
Best regards,
--
Nathan Chancellor <nathan@kernel.org>
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi: mpi3mr: Use proper format specifier in mpi3mr_sas_port_add()
2024-05-14 20:47 [PATCH] scsi: mpi3mr: Use proper format specifier in mpi3mr_sas_port_add() Nathan Chancellor
@ 2024-05-15 13:42 ` Martin K. Petersen
2024-05-16 15:04 ` Palmer Dabbelt
2024-05-21 2:40 ` Martin K. Petersen
1 sibling, 1 reply; 4+ messages in thread
From: Martin K. Petersen @ 2024-05-15 13:42 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Sathya Prakash Veerichetty, Kashyap Desai, Sumit Saxena,
Sreekanth Reddy, James E.J. Bottomley, Martin K. Petersen,
Tomas Henzl, mpi3mr-linuxdrv.pdl, linux-scsi, patches
Nathan,
> 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:
Applied to 6.10/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi: mpi3mr: Use proper format specifier in mpi3mr_sas_port_add()
2024-05-15 13:42 ` Martin K. Petersen
@ 2024-05-16 15:04 ` Palmer Dabbelt
0 siblings, 0 replies; 4+ messages in thread
From: Palmer Dabbelt @ 2024-05-16 15:04 UTC (permalink / raw)
To: martin.petersen
Cc: nathan, sathya.prakash, kashyap.desai, sumit.saxena,
sreekanth.reddy, jejb, martin.petersen, thenzl,
mpi3mr-linuxdrv.pdl, linux-scsi, patches
On Wed, 15 May 2024 06:42:12 PDT (-0700), martin.petersen@oracle.com wrote:
>
> Nathan,
>
>> 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:
>
> Applied to 6.10/scsi-staging, thanks!
This fixes rv32 as well, so
Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
(don't worry about up the review, it's mostly here so I can find it
again if I forget)
Thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi: mpi3mr: Use proper format specifier in mpi3mr_sas_port_add()
2024-05-14 20:47 [PATCH] scsi: mpi3mr: Use proper format specifier in mpi3mr_sas_port_add() Nathan Chancellor
2024-05-15 13:42 ` Martin K. Petersen
@ 2024-05-21 2:40 ` Martin K. Petersen
1 sibling, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2024-05-21 2:40 UTC (permalink / raw)
To: Sathya Prakash Veerichetty, Kashyap Desai, Sumit Saxena,
Sreekanth Reddy, James E.J. Bottomley, Tomas Henzl,
Nathan Chancellor
Cc: Martin K . Petersen, mpi3mr-linuxdrv.pdl, linux-scsi, patches
On Tue, 14 May 2024 13:47:23 -0700, Nathan Chancellor wrote:
> 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);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> [...]
Applied to 6.10/scsi-queue, thanks!
[1/1] scsi: mpi3mr: Use proper format specifier in mpi3mr_sas_port_add()
https://git.kernel.org/mkp/scsi/c/9f365cb8bbd0
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-05-21 2:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-14 20:47 [PATCH] scsi: mpi3mr: Use proper format specifier in mpi3mr_sas_port_add() Nathan Chancellor
2024-05-15 13:42 ` Martin K. Petersen
2024-05-16 15:04 ` Palmer Dabbelt
2024-05-21 2:40 ` 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