Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1501937 > unrolled thread

[PATCH] lpfc: use %zd format string for size_t

Started byArnd Bergmann <arnd@arndb.de>
First post2016-10-17 14:40 +0200
Last post2016-10-17 20:00 +0200
Articles 4 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] lpfc: use %zd format string for size_t Arnd Bergmann <arnd@arndb.de> - 2016-10-17 14:40 +0200
    Re: [PATCH] lpfc: use %zd format string for size_t Johannes Thumshirn <jthumshirn@suse.de> - 2016-10-17 15:40 +0200
    Re: [PATCH] lpfc: use %zd format string for size_t James Smart <james.smart@broadcom.com> - 2016-10-17 18:00 +0200
    Re: [PATCH] lpfc: use %zd format string for size_t "Martin K. Petersen" <martin.petersen@oracle.com> - 2016-10-17 20:00 +0200

#1501937 — [PATCH] lpfc: use %zd format string for size_t

FromArnd Bergmann <arnd@arndb.de>
Date2016-10-17 14:40 +0200
Subject[PATCH] lpfc: use %zd format string for size_t
Message-ID<stfmV-3uj-15@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1501968

FromJohannes Thumshirn <jthumshirn@suse.de>
Date2016-10-17 15:40 +0200
Message-ID<stgiZ-43Y-3@gated-at.bofh.it>
In reply to#1501937
On Mon, Oct 17, 2016 at 02:35:46PM +0200, Arnd Bergmann wrote:
> 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>
> ---

Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

[toc] | [prev] | [next] | [standalone]


#1502141

FromJames Smart <james.smart@broadcom.com>
Date2016-10-17 18:00 +0200
Message-ID<stiuu-5no-27@gated-at.bofh.it>
In reply to#1501937
Thanks

Signed-off-by: James Smart <james.smart@broadcom.com>

-- james


On 10/17/2016 5:35 AM, Arnd Bergmann wrote:
> 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;

[toc] | [prev] | [next] | [standalone]


#1502317

From"Martin K. Petersen" <martin.petersen@oracle.com>
Date2016-10-17 20:00 +0200
Message-ID<stkmB-6DJ-11@gated-at.bofh.it>
In reply to#1501937
>>>>> "Arnd" == Arnd Bergmann <arnd@arndb.de> writes:

Arnd> A recent bugfix introduced a harmless warning in the lpfc driver:
Arnd> drivers/scsi/lpfc/lpfc_init.c: In function 'lpfc_write_firmware':
Arnd> drivers/scsi/lpfc/lpfc_logmsg.h:56:45: error: format '%ld' expects
Arnd> argument of type 'long int', but argument 9 has type 'size_t {aka
Arnd> const unsigned int}' [-Werror=format=]

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

Applied to 4.10/scsi-queue.

-- 
Martin K. Petersen	Oracle Linux Engineering

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web