mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scsi: qedi: Add __printf to debug helpers and fix format strings
@ 2026-11-09 14:17 Adrián García Casado
  2026-11-09 22:50 ` kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: Adrián García Casado @ 2026-11-09 14:17 UTC (permalink / raw)
  To: Nilesh Javali, Manish Rangankar, Martin K . Petersen
  Cc: GR-ETH-Storage-Upstream, James E . J . Bottomley, linux-scsi,
	linux-kernel, Adrián García Casado

qedi_dbg_err(), qedi_dbg_warn(), qedi_dbg_notice(), and qedi_dbg_info()
format their variadic arguments via struct va_format and %pV, but unlike
their counterparts in qedf_dbg.h, they lack __printf() attributes in
qedi_dbg.h.

Add the missing __printf(4, 5) and __printf(5, 6) annotations to
qedi_dbg.h and fix the resulting -Wformat warnings exposed across
qedi_fw.c and qedi_main.c:

 - Use 0x%x instead of 0x%p for cqe->rqe_opaque (u16).
 - Use 0x%x instead of 0x%llx for pbl->address.hi and lo (__le32).
 - Use 0x%lx instead of 0x%x for qedi->qedi_err_flags (unsigned long).

Signed-off-by: Adrián García Casado <adriangarciacasado42@gmail.com>
---
 drivers/scsi/qedi/qedi_dbg.h  | 4 ++++
 drivers/scsi/qedi/qedi_fw.c   | 4 ++--
 drivers/scsi/qedi/qedi_main.c | 4 ++--
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/qedi/qedi_dbg.h b/drivers/scsi/qedi/qedi_dbg.h
index 8649518658691..70acb55847f4f 100644
--- a/drivers/scsi/qedi/qedi_dbg.h
+++ b/drivers/scsi/qedi/qedi_dbg.h
@@ -78,12 +78,16 @@ struct qedi_dbg_ctx {
 		qedi_dbg_info(pdev, __func__, __LINE__, level, fmt,	\
 			      ## __VA_ARGS__)
 
+__printf(4, 5)
 void qedi_dbg_err(struct qedi_dbg_ctx *qedi, const char *func, u32 line,
 		  const char *fmt, ...);
+__printf(4, 5)
 void qedi_dbg_warn(struct qedi_dbg_ctx *qedi, const char *func, u32 line,
 		   const char *fmt, ...);
+__printf(4, 5)
 void qedi_dbg_notice(struct qedi_dbg_ctx *qedi, const char *func, u32 line,
 		     const char *fmt, ...);
+__printf(5, 6)
 void qedi_dbg_info(struct qedi_dbg_ctx *qedi, const char *func, u32 line,
 		   u32 info, const char *fmt, ...);
 
diff --git a/drivers/scsi/qedi/qedi_fw.c b/drivers/scsi/qedi/qedi_fw.c
index c8af10c326532..18df8b0138ef5 100644
--- a/drivers/scsi/qedi/qedi_fw.c
+++ b/drivers/scsi/qedi/qedi_fw.c
@@ -339,7 +339,7 @@ static void qedi_get_rq_bdq_buf(struct qedi_ctx *qedi,
 	}
 
 	QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_CONN,
-		  "rqe_opaque [0x%p], idx [%d]\n", cqe->rqe_opaque, idx);
+		  "rqe_opaque [0x%x], idx [%d]\n", cqe->rqe_opaque, idx);
 
 	QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_CONN,
 		  "unsol_cqe_type = %d\n", cqe->unsol_cqe_type);
@@ -378,7 +378,7 @@ static void qedi_put_rq_bdq_buf(struct qedi_ctx *qedi,
 	pbl->address.hi = cpu_to_le32(QEDI_U64_HI(qedi->bdq[idx].buf_dma));
 	pbl->address.lo = cpu_to_le32(QEDI_U64_LO(qedi->bdq[idx].buf_dma));
 	QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_CONN,
-		  "pbl [0x%p] pbl->address hi [0x%llx] lo [0x%llx] idx [%d]\n",
+		  "pbl [0x%p] pbl->address hi [0x%x] lo [0x%x] idx [%d]\n",
 		  pbl, pbl->address.hi, pbl->address.lo, idx);
 	pbl->opaque.iscsi_opaque.reserved_zero[0] = 0;
 	pbl->opaque.iscsi_opaque.reserved_zero[1] = 0;
diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c
index f394fcbb97e7e..278dcea9f05e9 100644
--- a/drivers/scsi/qedi/qedi_main.c
+++ b/drivers/scsi/qedi/qedi_main.c
@@ -1128,7 +1128,7 @@ void qedi_schedule_hw_err_handler(void *dev,
 		qedi->qedi_err_flags = qedi_flags_override;
 
 	QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_INFO,
-		  "HW error handler scheduled, err=%d err_flags=0x%x\n",
+		  "HW error handler scheduled, err=%d err_flags=0x%lx\n",
 		  err_type, qedi->qedi_err_flags);
 
 	switch (err_type) {
@@ -1581,7 +1581,7 @@ static int qedi_alloc_bdq(struct qedi_ctx *qedi)
 		pbl->address.lo =
 				cpu_to_le32(QEDI_U64_LO(qedi->bdq[i].buf_dma));
 		QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_CONN,
-			  "pbl [0x%p] pbl->address hi [0x%llx] lo [0x%llx], idx [%d]\n",
+			  "pbl [0x%p] pbl->address hi [0x%x] lo [0x%x], idx [%d]\n",
 			  pbl, pbl->address.hi, pbl->address.lo, i);
 		pbl->opaque.iscsi_opaque.reserved_zero[0] = 0;
 		pbl->opaque.iscsi_opaque.reserved_zero[1] = 0;
-- 
2.39.5


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-09 22:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-09 14:17 [PATCH] scsi: qedi: Add __printf to debug helpers and fix format strings Adrián García Casado
2026-11-09 22:50 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®