From: Arnd Bergmann <arnd@arndb.de>
To: James Smart <james.smart@broadcom.com>,
Dick Kennedy <dick.kennedy@broadcom.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Arnd Bergmann <arnd@arndb.de>, Hannes Reinecke <hare@suse.de>,
Colin Ian King <colin.king@canonical.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/4] scsi: lpfc: fix 32-bit format string warning
Date: Mon, 4 Mar 2019 20:39:09 +0100 [thread overview]
Message-ID: <20190304193917.702601-2-arnd@arndb.de> (raw)
In-Reply-To: <20190304193917.702601-1-arnd@arndb.de>
On 32-bit architectures, we see a warning when %ld is used to
print a size_t:
In file included from drivers/scsi/lpfc/lpfc_init.c:62:
drivers/scsi/lpfc/lpfc_init.c: In function 'lpfc_new_io_buf':
drivers/scsi/lpfc/lpfc_logmsg.h:62:45: error: format '%ld' expects argument of type 'long int', but argument 5 has type 'unsigned int' [-Werror=format=]
This is harmless, but portable code should just use %zd to
avoid the warning.
Fixes: 0794d601d174 ("scsi: lpfc: Implement common IO buffers between NVME and SCSI")
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 3b5873f6751e..6e6bd1b3237d 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -4090,7 +4090,7 @@ lpfc_new_io_buf(struct lpfc_hba *phba, int num_to_alloc)
/* Sanity check to ensure our sizing is right for both SCSI and NVME */
if (sizeof(struct lpfc_io_buf) > LPFC_COMMON_IO_BUF_SZ) {
lpfc_printf_log(phba, KERN_ERR, LOG_FCP,
- "6426 Common buffer size %ld exceeds %d\n",
+ "6426 Common buffer size %zd exceeds %d\n",
sizeof(struct lpfc_io_buf),
LPFC_COMMON_IO_BUF_SZ);
return 0;
--
2.20.0
next prev parent reply other threads:[~2019-03-04 19:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-04 19:39 [PATCH 1/4] scsi: lpfc: fix unused variable warning Arnd Bergmann
2019-03-04 19:39 ` Arnd Bergmann [this message]
2019-03-07 0:15 ` [PATCH 2/4] scsi: lpfc: fix 32-bit format string warning Martin K. Petersen
2019-03-04 19:39 ` [PATCH 3/4] scsi: qla2xxx: avoid printf format warning Arnd Bergmann
2019-03-06 17:29 ` Himanshu Madhani
2019-03-06 17:54 ` Martin K. Petersen
2019-03-04 19:39 ` [PATCH 4/4] scsi: ufs: hisi: fix ufs_hba_variant_ops passing Arnd Bergmann
2019-03-06 11:43 ` Avri Altman
2019-03-06 17:45 ` Martin K. Petersen
2019-03-07 0:15 ` [PATCH 1/4] scsi: lpfc: fix unused variable warning Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190304193917.702601-2-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=colin.king@canonical.com \
--cc=dick.kennedy@broadcom.com \
--cc=hare@suse.de \
--cc=james.smart@broadcom.com \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®