public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lpfc: use %zd format string for size_t
@ 2016-10-17 12:35 Arnd Bergmann
  2016-10-17 13:39 ` Johannes Thumshirn
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Arnd Bergmann @ 2016-10-17 12:35 UTC (permalink / raw)
  To: James Smart, Dick Kennedy, James E.J. Bottomley,
	Martin K. Petersen
  Cc: Arnd Bergmann, Hannes Reinecke, James Bottomley,
	Sebastian Herbszt, Johannes Thumshirn, linux-scsi, linux-kernel

A recent bugfix introduced a harmless warning in the lpfc driver:

drivers/scsi/lpfc/lpfc_init.c: In function 'lpfc_write_firmware':
drivers/scsi/lpfc/lpfc_logmsg.h:56:45: error: format '%ld' expects argument of type 'long int', but argument 9 has type 'size_t {aka const unsigned int}' [-Werror=format=]

'size_t' is always the same width as 'long' in the kernel, but the compiler
doesn't know that. The %z modifier is what the standard expects to be
used here, and this shuts up the warning.

Fixes: 679053c651fb ("scsi: lpfc: Fix fw download on SLI-4 FC adapters")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/scsi/lpfc/lpfc_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 7be9b8a7bb19..4776fd85514f 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -10332,7 +10332,7 @@ lpfc_write_firmware(const struct firmware *fw, void *context)
 	    ftype != LPFC_FILE_TYPE_GROUP || fsize != fw->size) {
 		lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
 				"3022 Invalid FW image found. "
-				"Magic:%x Type:%x ID:%x Size %d %ld\n",
+				"Magic:%x Type:%x ID:%x Size %d %zd\n",
 				magic_number, ftype, fid, fsize, fw->size);
 		rc = -EINVAL;
 		goto release_out;
-- 
2.9.0

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

end of thread, other threads:[~2016-10-28 23:20 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-17 12:35 [PATCH] lpfc: use %zd format string for size_t Arnd Bergmann
2016-10-17 13:39 ` Johannes Thumshirn
2016-10-17 15:53 ` James Smart
2016-10-17 17:59 ` Martin K. Petersen
2016-10-28 21:03 ` Vineet Gupta
2016-10-28 21:33   ` Arnd Bergmann
2016-10-28 21:44     ` Vineet Gupta
2016-10-28 21:48       ` Arnd Bergmann
2016-10-28 21:52       ` Vineet Gupta
2016-10-28 21:58         ` Vineet Gupta
2016-10-28 22:03           ` Arnd Bergmann
2016-10-28 23:16             ` Vineet Gupta

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