[PATCH] scsi: qla2xxx: Fix size_t format specifier in qla29xx_process_rd_image()

Nathan Chancellor <[email protected]>
Newsgroups org.kernel.vger.linux-scsi,org.kernel.vger.linux-kernel
Message-ID <20260811-scsi-qla2xxxx-qla_init-wformat-v1-1-50760021914f@kernel.org>
After commit c3930ec119cb ("scsi: qla2xxx: Add FC operational firmware
load for 29xx"), there is a warning due to an incorrect format specifier
for a 'size_t' variable when building for 32-bit platforms, for which
'size_t' is 'unsigned int':

  drivers/scsi/qla2xxx/qla_init.c: In function 'qla29xx_process_rd_image':
  drivers/scsi/qla2xxx/qla_init.c:9272:74: error: format '%lx' expects argument of type 'long unsigned int', but argument 6 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
   9272 |                             "TIM section too large (0x%x bytes, ring 0x%lx bytes).\n",
        |                                                                        ~~^
        |                                                                          |
        |                                                                          long unsigned int
        |                                                                        %x
   9273 |                             section_size,
   9274 |                             req->length * qla_req_entry_size(ha));
        |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        |                                         |
        |                                         size_t {aka unsigned int}
  cc1: all warnings being treated as errors

Use '%zx', the proper 'size_t' format specifier, to clear up the
warning.

Fixes: c3930ec119cb ("scsi: qla2xxx: Add FC operational firmware load for 29xx")
Signed-off-by: Nathan Chancellor <[email protected]>
---
 drivers/scsi/qla2xxx/qla_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 2b9a9c672ec6..900cd141928e 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -9269,7 +9269,7 @@ static int qla29xx_process_rd_image(struct scsi_qla_host *vha,
 	if (section == TIM) {
 		if (section_size > req->length * qla_req_entry_size(ha)) {
 			ql_log(ql_log_fatal, vha, 0x0098,
-			    "TIM section too large (0x%x bytes, ring 0x%lx bytes).\n",
+			    "TIM section too large (0x%x bytes, ring 0x%zx bytes).\n",
 			    section_size,
 			    req->length * qla_req_entry_size(ha));
 			return QLA_FUNCTION_FAILED;

---
base-commit: 376a3960e5efe85ff765abfb5b5b7e4655ad6aed
change-id: 20260811-scsi-qla2xxxx-qla_init-wformat-c542b3cfa6fa

Best regards,
--  
Cheers,
Nathan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.