lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <EC5BB501-0EEC-4F33-AEB9-69765E50A171@oracle.com>
Date:   Tue, 17 Jan 2023 18:06:31 +0000
From:   Himanshu Madhani <himanshu.madhani@...cle.com>
To:     Arnd Bergmann <arnd@...nel.org>
CC:     Nilesh Javali <njavali@...vell.com>,
        GR-QLogic-Storage-Upstream <GR-QLogic-Storage-Upstream@...vell.com>,
        "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        Martin Petersen <martin.petersen@...cle.com>,
        Quinn Tran <qutran@...vell.com>, Arnd Bergmann <arnd@...db.de>,
        Saurav Kashyap <skashyap@...vell.com>,
        Tom Rix <trix@...hat.com>,
        linux-scsi <linux-scsi@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] qla2xxx: fix printk format string



> On Jan 17, 2023, at 9:00 AM, Arnd Bergmann <arnd@...nel.org> wrote:
> 
> From: Arnd Bergmann <arnd@...db.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@...db.de>
> ---
> 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
> 

Reviewed-by: Himanshu Madhani <himansnhu.madhani@...cle.com <mailto:himansnhu.madhani@...cle.com>>

-- 
Himanshu Madhani Oracle Linux Engineering

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ