public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: Sathya Prakash Veerichetty <sathya.prakash@broadcom.com>,
	Kashyap Desai <kashyap.desai@broadcom.com>,
	Sumit Saxena <sumit.saxena@broadcom.com>,
	Sreekanth Reddy <sreekanth.reddy@broadcom.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Chandrakanth patil <chandrakanth.patil@broadcom.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Ranjan Kumar <ranjan.kumar@broadcom.com>,
	"Shin'ichiro Kawasaki" <shinichiro.kawasaki@wdc.com>,
	mpi3mr-linuxdrv.pdl@broadcom.com, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] mpi3mr: fix printk() format strings
Date: Thu,  7 Dec 2023 15:28:06 +0100	[thread overview]
Message-ID: <20231207142813.935717-1-arnd@kernel.org> (raw)

From: Arnd Bergmann <arnd@arndb.de>

The newly introduced error messages get multiple format strings wrong: size_t must
be printed using the %z modifier rather than %l and dma_addr_t must be printed
by reference using the special %pad pointer type:

drivers/scsi/mpi3mr/mpi3mr_app.c: In function 'mpi3mr_build_nvme_prp':
include/linux/kern_levels.h:5:25: error: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'dma_addr_t' {aka 'unsigned int'} [-Werror=format=]
drivers/scsi/mpi3mr/mpi3mr_app.c:949:25: note: in expansion of macro 'dprint_bsg_err'
  949 |                         dprint_bsg_err(mrioc,
      |                         ^~~~~~~~~~~~~~
include/linux/kern_levels.h:5:25: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
drivers/scsi/mpi3mr/mpi3mr_app.c:1112:41: note: in expansion of macro 'dprint_bsg_err'
 1112 |                                         dprint_bsg_err(mrioc,
      |                                         ^~~~~~~~~~~~~~

Fixes: 9536af615dc9 ("scsi: mpi3mr: Support for preallocation of SGL BSG data buffers part-3")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/scsi/mpi3mr/mpi3mr_app.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/mpi3mr/mpi3mr_app.c b/drivers/scsi/mpi3mr/mpi3mr_app.c
index 4b93b7440da6..0380996b5ad2 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_app.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_app.c
@@ -947,8 +947,8 @@ static int mpi3mr_build_nvme_prp(struct mpi3mr_ioc *mrioc,
 		dma_addr = drv_buf_iter->dma_desc[count].dma_addr;
 		if (dma_addr & page_mask) {
 			dprint_bsg_err(mrioc,
-				       "%s:dma_addr 0x%llx is not aligned with page size 0x%x\n",
-				       __func__,  dma_addr, dev_pgsz);
+				       "%s:dma_addr %pad is not aligned with page size 0x%x\n",
+				       __func__,  &dma_addr, dev_pgsz);
 			return -1;
 		}
 	}
@@ -1110,7 +1110,7 @@ static int mpi3mr_build_nvme_prp(struct mpi3mr_ioc *mrioc,
 				if ((++desc_count) >=
 				   drv_buf_iter->num_dma_desc) {
 					dprint_bsg_err(mrioc,
-						       "%s: Invalid len %ld while building PRP\n",
+						       "%s: Invalid len %zd while building PRP\n",
 						       __func__, length);
 					goto err_out;
 				}
-- 
2.39.2


             reply	other threads:[~2023-12-07 14:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07 14:28 Arnd Bergmann [this message]
2023-12-08  0:30 ` [PATCH] mpi3mr: fix printk() format strings Randy Dunlap
2023-12-08 17:05 ` Martin K. Petersen
2023-12-19  2:18 ` 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=20231207142813.935717-1-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=arnd@arndb.de \
    --cc=chandrakanth.patil@broadcom.com \
    --cc=jejb@linux.ibm.com \
    --cc=kashyap.desai@broadcom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mpi3mr-linuxdrv.pdl@broadcom.com \
    --cc=ranjan.kumar@broadcom.com \
    --cc=sathya.prakash@broadcom.com \
    --cc=shinichiro.kawasaki@wdc.com \
    --cc=sreekanth.reddy@broadcom.com \
    --cc=sumit.saxena@broadcom.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