mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scsi: qla2xxx: fix printk format string warning on 32-bit
@ 2017-06-09 10:46 Arnd Bergmann
  2017-06-09 14:09 ` Madhani, Himanshu
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2017-06-09 10:46 UTC (permalink / raw)
  To: qla2xxx-upstream, James E.J. Bottomley, Martin K. Petersen
  Cc: Arnd Bergmann, Himanshu Madhani, Quinn Tran, Nicholas Bellinger,
	linux-scsi, linux-kernel

On 32-bit architectures, we using %lx to print a size_t causes a harmless
warning:

qla2xxx/qla_init.c: In function 'qla24xx_load_risc_flash':
qla2xxx/qla_init.c:6407:7: error: format '%lx' expects argument of type 'long unsigned int', but argument 5 has type 'unsigned int' [-Werror=format=]
qla2xxx/qla_init.c: In function 'qla24xx_load_risc_blob':
qla2xxx/qla_init.c:6709:7: error: format '%lx' expects argument of type 'long unsigned int', but argument 5 has type 'unsigned int' [-Werror=format=]

The correct format string is %zx.

Fixes: 0f110b54d157 ("scsi: qla2xxx: Retain loop test for fwdump length exceeding buffer length")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/scsi/qla2xxx/qla_init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 436968ad4484..730e7fe4344a 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -6404,7 +6404,7 @@ qla24xx_load_risc_flash(scsi_qla_host_t *vha, uint32_t *srisc_addr,
 	    "-> template size %x bytes\n", dlen);
 	if (dlen > risc_size * sizeof(*dcode)) {
 		ql_log(ql_log_warn, vha, 0x0167,
-		    "Failed fwdump template exceeds array by %lx bytes\n",
+		    "Failed fwdump template exceeds array by %zx bytes\n",
 		    (size_t)(dlen - risc_size * sizeof(*dcode)));
 		goto default_template;
 	}
@@ -6706,7 +6706,7 @@ qla24xx_load_risc_blob(scsi_qla_host_t *vha, uint32_t *srisc_addr)
 	    "-> template size %x bytes\n", dlen);
 	if (dlen > risc_size * sizeof(*fwcode)) {
 		ql_log(ql_log_warn, vha, 0x0177,
-		    "Failed fwdump template exceeds array by %lx bytes\n",
+		    "Failed fwdump template exceeds array by %zx bytes\n",
 		    (size_t)(dlen - risc_size * sizeof(*fwcode)));
 		goto default_template;
 	}
-- 
2.9.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] scsi: qla2xxx: fix printk format string warning on 32-bit
  2017-06-09 10:46 [PATCH] scsi: qla2xxx: fix printk format string warning on 32-bit Arnd Bergmann
@ 2017-06-09 14:09 ` Madhani, Himanshu
  0 siblings, 0 replies; 2+ messages in thread
From: Madhani, Himanshu @ 2017-06-09 14:09 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Dept-Eng QLA2xxx Upstream, James E.J. Bottomley,
	Martin K. Petersen, Tran, Quinn, Nicholas Bellinger, linux-scsi,
	linux-kernel

Hi Arnd, 

> On Jun 9, 2017, at 3:46 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> 
> On 32-bit architectures, we using %lx to print a size_t causes a harmless
> warning:
> 
> qla2xxx/qla_init.c: In function 'qla24xx_load_risc_flash':
> qla2xxx/qla_init.c:6407:7: error: format '%lx' expects argument of type 'long unsigned int', but argument 5 has type 'unsigned int' [-Werror=format=]
> qla2xxx/qla_init.c: In function 'qla24xx_load_risc_blob':
> qla2xxx/qla_init.c:6709:7: error: format '%lx' expects argument of type 'long unsigned int', but argument 5 has type 'unsigned int' [-Werror=format=]
> 
> The correct format string is %zx.
> 
> Fixes: 0f110b54d157 ("scsi: qla2xxx: Retain loop test for fwdump length exceeding buffer length")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/scsi/qla2xxx/qla_init.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
> index 436968ad4484..730e7fe4344a 100644
> --- a/drivers/scsi/qla2xxx/qla_init.c
> +++ b/drivers/scsi/qla2xxx/qla_init.c
> @@ -6404,7 +6404,7 @@ qla24xx_load_risc_flash(scsi_qla_host_t *vha, uint32_t *srisc_addr,
> 	    "-> template size %x bytes\n", dlen);
> 	if (dlen > risc_size * sizeof(*dcode)) {
> 		ql_log(ql_log_warn, vha, 0x0167,
> -		    "Failed fwdump template exceeds array by %lx bytes\n",
> +		    "Failed fwdump template exceeds array by %zx bytes\n",
> 		    (size_t)(dlen - risc_size * sizeof(*dcode)));
> 		goto default_template;
> 	}
> @@ -6706,7 +6706,7 @@ qla24xx_load_risc_blob(scsi_qla_host_t *vha, uint32_t *srisc_addr)
> 	    "-> template size %x bytes\n", dlen);
> 	if (dlen > risc_size * sizeof(*fwcode)) {
> 		ql_log(ql_log_warn, vha, 0x0177,
> -		    "Failed fwdump template exceeds array by %lx bytes\n",
> +		    "Failed fwdump template exceeds array by %zx bytes\n",
> 		    (size_t)(dlen - risc_size * sizeof(*fwcode)));
> 		goto default_template;
> 	}
> -- 
> 2.9.0
> 

I had posted patch already to fix this https://patchwork.kernel.org/patch/9769981/

Thanks,
- Himanshu

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-09 14:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-09 10:46 [PATCH] scsi: qla2xxx: fix printk format string warning on 32-bit Arnd Bergmann
2017-06-09 14:09 ` Madhani, Himanshu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®