Skip to contentSkip to conversation

scsi: mpi3mr: Fix printf() specifier

PATCH In review Andy Shevchenko 1 participant 2 messages Jun 2, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: mpi3mr: Fix printf() specifier

Compiler is not happy about format string

format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Werror=format=]
note: in expansion of macro ‘ioc_warn’
1367 | ioc_warn(mrioc, "skipping port %u, max allowed value is %lu\n",

Fix the specifier to make it possible to build.

---
 drivers/scsi/mpi3mr/mpi3mr_transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/mpi3mr/mpi3mr_transport.c +1 -1
index 329cc6ec3b58..82aa4e418c5a 100644
@@ -1364,7 +1364,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;
 		}
Signature · 1 line
2.43.0.rc1.1336.g36b5255a03ac
#1 lore raw
Quoted 7 lines · Andy Shevchenko

Compiler is not happy about format string

format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Werror=format=]
note: in expansion of macro ‘ioc_warn’
1367 | ioc_warn(mrioc, "skipping port %u, max allowed value is %lu\n",

Fix the specifier to make it possible to build.

Already fixed by 9f365cb8bbd0 ("scsi: mpi3mr: Use proper format specifier in mpi3mr_sas_port_add()").

Signature · 2 lines
With Best Regards,
Andy Shevchenko