Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935306AbcJQPxs (ORCPT ); Mon, 17 Oct 2016 11:53:48 -0400 Received: from mail-pf0-f173.google.com ([209.85.192.173]:33560 "EHLO mail-pf0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964986AbcJQPxi (ORCPT ); Mon, 17 Oct 2016 11:53:38 -0400 Subject: Re: [PATCH] lpfc: use %zd format string for size_t To: Arnd Bergmann , James Smart , Dick Kennedy , "James E.J. Bottomley" , "Martin K. Petersen" References: <20161017123605.2217411-1-arnd@arndb.de> Cc: Hannes Reinecke , James Bottomley , Sebastian Herbszt , Johannes Thumshirn , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org From: James Smart Message-ID: Date: Mon, 17 Oct 2016 08:53:33 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <20161017123605.2217411-1-arnd@arndb.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1473 Lines: 36 Thanks Signed-off-by: James Smart -- 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 > --- > 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;