Commit d794a231 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Martin K. Petersen

scsi: qla2xxx: Fix printk() format string

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: 82d8dfd2 ("scsi: qla2xxx: edif: Fix performance dip due to lock contention")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Reviewed-by: default avatarBart Van Assche <bvanassche@acm.org>
Reviewed-by: default avatarHimanshu Madhani &lt;himansnhu.madhani@oracle.com <mailto:himansnhu.madhani@oracle.com&gt;>
Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
Link: https://lore.kernel.org/r/20230117170029.2387516-1-arnd@kernel.orgSigned-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent fd5df558
......@@ -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 *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment