Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db6b2060 authored by Joe Perches's avatar Joe Perches Committed by Martin K. Petersen
Browse files

scsi: qedf: Fix defective logging format and argument mismatches



Add __printf compiler verification of format and arguments.  Fix
fallout.

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Acked-by: default avatarChad Dupuis <chad.dupuis@cavium.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent c527de41
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -81,14 +81,17 @@ struct qedf_dbg_ctx {
#define QEDF_INFO(pdev, level, fmt, ...)	\
		qedf_dbg_info(pdev, __func__, __LINE__, level, fmt,	\
			      ## __VA_ARGS__)

extern void qedf_dbg_err(struct qedf_dbg_ctx *qedf, const char *func, u32 line,
__printf(4, 5)
void qedf_dbg_err(struct qedf_dbg_ctx *qedf, const char *func, u32 line,
			  const char *fmt, ...);
extern void qedf_dbg_warn(struct qedf_dbg_ctx *qedf, const char *func, u32 line,
__printf(4, 5)
void qedf_dbg_warn(struct qedf_dbg_ctx *qedf, const char *func, u32 line,
			   const char *, ...);
extern void qedf_dbg_notice(struct qedf_dbg_ctx *qedf, const char *func,
__printf(4, 5)
void qedf_dbg_notice(struct qedf_dbg_ctx *qedf, const char *func,
			    u32 line, const char *, ...);
extern void qedf_dbg_info(struct qedf_dbg_ctx *qedf, const char *func, u32 line,
__printf(5, 6)
void qedf_dbg_info(struct qedf_dbg_ctx *qedf, const char *func, u32 line,
			  u32 info, const char *fmt, ...);

/* GRC Dump related defines */
+1 −1
Original line number Diff line number Diff line
@@ -203,7 +203,7 @@ void qedf_fip_recv(struct qedf_ctx *qedf, struct sk_buff *skb)
			case FIP_DT_MAC:
				mp = (struct fip_mac_desc *)desc;
				QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_LL2,
				    "fd_mac=%pM.\n", __func__, mp->fd_mac);
				    "fd_mac=%pM\n", mp->fd_mac);
				ether_addr_copy(cvl_mac, mp->fd_mac);
				break;
			case FIP_DT_NAME:
+2 −2
Original line number Diff line number Diff line
@@ -1342,7 +1342,7 @@ void qedf_scsi_completion(struct qedf_ctx *qedf, struct fcoe_cqe *cqe,
		} else {
			refcount = kref_read(&io_req->refcount);
			QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_IO,
			    "%d:0:%d:%d xid=0x%0x op=0x%02x "
			    "%d:0:%d:%lld xid=0x%0x op=0x%02x "
			    "lba=%02x%02x%02x%02x cdb_status=%d "
			    "fcp_resid=0x%x refcount=%d.\n",
			    qedf->lport->host->host_no, sc_cmd->device->id,
@@ -1426,7 +1426,7 @@ void qedf_scsi_done(struct qedf_ctx *qedf, struct qedf_ioreq *io_req,

	sc_cmd->result = result << 16;
	refcount = kref_read(&io_req->refcount);
	QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_IO, "%d:0:%d:%d: Completing "
	QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_IO, "%d:0:%d:%lld: Completing "
	    "sc_cmd=%p result=0x%08x op=0x%02x lba=0x%02x%02x%02x%02x, "
	    "allowed=%d retries=%d refcount=%d.\n",
	    qedf->lport->host->host_no, sc_cmd->device->id,