The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Nick Desaulniers <ndesaulniers@google.com>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Nilesh Javali <njavali@marvell.com>,
	GR-QLogic-Storage-Upstream@marvell.com,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Himanshu Madhani <himanshu.madhani@oracle.com>,
	Quinn Tran <qutran@marvell.com>, Arnd Bergmann <arnd@arndb.de>,
	Saurav Kashyap <skashyap@marvell.com>, Tom Rix <trix@redhat.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	llvm@lists.linux.dev
Subject: Re: [PATCH] qla2xxx: fix printk format string
Date: Tue, 17 Jan 2023 11:29:38 -0800	[thread overview]
Message-ID: <20230117192938.nryt2tlgjymkr5ux@google.com> (raw)
In-Reply-To: <20230117170029.2387516-1-arnd@kernel.org>

On Tue, Jan 17, 2023 at 06:00:15PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> Printing a size_t value that is the result of the sizeof() operator requires
> using the %z format string modifier to avoid a warning on 32-bit architectures:
> 
> drivers/scsi/qla2xxx/qla_mid.c: In function 'qla_create_buf_pool':
> drivers/scsi/qla2xxx/qla_mid.c:1094:51: error: format '%ld' expects argument of type 'long int', but argument 5 has type 'unsigned int' [-Werror=format=]
>  1094 |                     "Failed to allocate buf_map(%ld).\n", sz * sizeof(unsigned long));
>       |                                                 ~~^       ~~~~~~~~~~~~~~~~~~~~~~~~~~
>       |                                                   |          |
>       |                                                   long int   unsigned int
>       |                                                 %d
> 
> Fixes: 82d8dfd2a238 ("scsi: qla2xxx: edif: Fix performance dip due to lock contention")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thanks for the patch!

Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reported-by: "kernelci.org bot" <bot@kernelci.org>
Link: https://lore.kernel.org/llvm/63c4ddba.170a0220.1547e.db75@mx.google.com/

> ---
>  drivers/scsi/qla2xxx/qla_mid.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c
> index c6ca39b8e23d..1483f6258f92 100644
> --- a/drivers/scsi/qla2xxx/qla_mid.c
> +++ b/drivers/scsi/qla2xxx/qla_mid.c
> @@ -1091,7 +1091,7 @@ int qla_create_buf_pool(struct scsi_qla_host *vha, struct qla_qpair *qp)
>  	qp->buf_pool.buf_map   = kcalloc(sz, sizeof(long), GFP_KERNEL);
>  	if (!qp->buf_pool.buf_map) {
>  		ql_log(ql_log_warn, vha, 0x0186,
> -		    "Failed to allocate buf_map(%ld).\n", sz * sizeof(unsigned long));
> +		    "Failed to allocate buf_map(%zd).\n", sz * sizeof(unsigned long));
>  		return -ENOMEM;
>  	}
>  	sz = qp->req->length * sizeof(void *);
> -- 
> 2.39.0
> 
> 

  parent reply	other threads:[~2023-01-17 21:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-17 17:00 [PATCH] qla2xxx: fix printk format string Arnd Bergmann
2023-01-17 17:39 ` Bart Van Assche
2023-01-17 18:06 ` Himanshu Madhani
2023-01-17 19:29 ` Nick Desaulniers [this message]
2023-01-18 23:35 ` Martin K. Petersen
2023-01-27  3:22 ` 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=20230117192938.nryt2tlgjymkr5ux@google.com \
    --to=ndesaulniers@google.com \
    --cc=GR-QLogic-Storage-Upstream@marvell.com \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=himanshu.madhani@oracle.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=martin.petersen@oracle.com \
    --cc=njavali@marvell.com \
    --cc=qutran@marvell.com \
    --cc=skashyap@marvell.com \
    --cc=trix@redhat.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