All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: qedf: Fix defective logging format and argument mismatches
@ 2017-03-04  8:07 Joe Perches
  2017-03-06 17:52 ` kbuild test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Joe Perches @ 2017-03-04  8:07 UTC (permalink / raw)
  To: QLogic-Storage-Upstream
  Cc: James E.J. Bottomley, Martin K. Petersen, linux-scsi, linux-kernel

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

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/scsi/qedf/qedf_dbg.h | 13 ++++++++-----
 drivers/scsi/qedf/qedf_fip.c |  2 +-
 drivers/scsi/qedf/qedf_io.c  |  4 ++--
 3 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/qedf/qedf_dbg.h b/drivers/scsi/qedf/qedf_dbg.h
index 23bd70628a2f..7d173f48a81e 100644
--- a/drivers/scsi/qedf/qedf_dbg.h
+++ b/drivers/scsi/qedf/qedf_dbg.h
@@ -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 */
diff --git a/drivers/scsi/qedf/qedf_fip.c b/drivers/scsi/qedf/qedf_fip.c
index 868d423380d1..ed58b9104f58 100644
--- a/drivers/scsi/qedf/qedf_fip.c
+++ b/drivers/scsi/qedf/qedf_fip.c
@@ -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:
diff --git a/drivers/scsi/qedf/qedf_io.c b/drivers/scsi/qedf/qedf_io.c
index ee0dcf9d3aba..46debe5034af 100644
--- a/drivers/scsi/qedf/qedf_io.c
+++ b/drivers/scsi/qedf/qedf_io.c
@@ -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,
-- 
2.10.0.rc2.1.g053435c

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

* Re: [PATCH] scsi: qedf: Fix defective logging format and argument mismatches
  2017-03-04  8:07 [PATCH] scsi: qedf: Fix defective logging format and argument mismatches Joe Perches
@ 2017-03-06 17:52 ` kbuild test robot
  2017-03-06 18:03 ` kbuild test robot
  2017-03-06 19:33 ` Chad Dupuis
  2 siblings, 0 replies; 6+ messages in thread
From: kbuild test robot @ 2017-03-06 17:52 UTC (permalink / raw)
  To: Joe Perches
  Cc: kbuild-all, QLogic-Storage-Upstream, James E.J. Bottomley,
	Martin K. Petersen, linux-scsi, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 3251 bytes --]

Hi Joe,

[auto build test WARNING on scsi/for-next]
[also build test WARNING on v4.11-rc1 next-20170306]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Joe-Perches/scsi-qedf-Fix-defective-logging-format-and-argument-mismatches/20170307-005400
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: xtensa-allmodconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 4.9.0
reproduce:
        wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=xtensa 

All warnings (new ones prefixed by >>):

   drivers/scsi/qedf/qedf_main.c: In function 'qedf_alloc_bdq':
>> drivers/scsi/qedf/qedf_main.c:2458:2: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 7 has type 'dma_addr_t' [-Wformat=]
     QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_DISC,
     ^

vim +2458 drivers/scsi/qedf/qedf_main.c

61d8658b Dupuis, Chad 2017-02-15  2442  		}
61d8658b Dupuis, Chad 2017-02-15  2443  	}
61d8658b Dupuis, Chad 2017-02-15  2444  
61d8658b Dupuis, Chad 2017-02-15  2445  	/* Alloc dma memory for BDQ page buffer list */
61d8658b Dupuis, Chad 2017-02-15  2446  	qedf->bdq_pbl_mem_size =
61d8658b Dupuis, Chad 2017-02-15  2447  	    QEDF_BDQ_SIZE * sizeof(struct scsi_bd);
61d8658b Dupuis, Chad 2017-02-15  2448  	qedf->bdq_pbl_mem_size =
61d8658b Dupuis, Chad 2017-02-15  2449  	    ALIGN(qedf->bdq_pbl_mem_size, QEDF_PAGE_SIZE);
61d8658b Dupuis, Chad 2017-02-15  2450  
61d8658b Dupuis, Chad 2017-02-15  2451  	qedf->bdq_pbl = dma_alloc_coherent(&qedf->pdev->dev,
61d8658b Dupuis, Chad 2017-02-15  2452  	    qedf->bdq_pbl_mem_size, &qedf->bdq_pbl_dma, GFP_KERNEL);
61d8658b Dupuis, Chad 2017-02-15  2453  	if (!qedf->bdq_pbl) {
61d8658b Dupuis, Chad 2017-02-15  2454  		QEDF_ERR(&(qedf->dbg_ctx), "Could not allocate BDQ PBL.\n");
61d8658b Dupuis, Chad 2017-02-15  2455  		return -ENOMEM;
61d8658b Dupuis, Chad 2017-02-15  2456  	}
61d8658b Dupuis, Chad 2017-02-15  2457  
61d8658b Dupuis, Chad 2017-02-15 @2458  	QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_DISC,
61d8658b Dupuis, Chad 2017-02-15  2459  	    "BDQ PBL addr=0x%p dma=0x%llx.\n", qedf->bdq_pbl,
61d8658b Dupuis, Chad 2017-02-15  2460  	    qedf->bdq_pbl_dma);
61d8658b Dupuis, Chad 2017-02-15  2461  
61d8658b Dupuis, Chad 2017-02-15  2462  	/*
61d8658b Dupuis, Chad 2017-02-15  2463  	 * Populate BDQ PBL with physical and virtual address of individual
61d8658b Dupuis, Chad 2017-02-15  2464  	 * BDQ buffers
61d8658b Dupuis, Chad 2017-02-15  2465  	 */
61d8658b Dupuis, Chad 2017-02-15  2466  	pbl = (struct scsi_bd *)qedf->bdq_pbl;

:::::: The code at line 2458 was first introduced by commit
:::::: 61d8658b4a435eac729966cc94cdda077a8df5cd scsi: qedf: Add QLogic FastLinQ offload FCoE driver framework.

:::::: TO: Dupuis, Chad <chad.dupuis@cavium.com>
:::::: CC: Martin K. Petersen <martin.petersen@oracle.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 48596 bytes --]

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

* Re: [PATCH] scsi: qedf: Fix defective logging format and argument mismatches
  2017-03-04  8:07 [PATCH] scsi: qedf: Fix defective logging format and argument mismatches Joe Perches
  2017-03-06 17:52 ` kbuild test robot
@ 2017-03-06 18:03 ` kbuild test robot
  2017-03-06 18:17   ` Joe Perches
  2017-03-06 19:33 ` Chad Dupuis
  2 siblings, 1 reply; 6+ messages in thread
From: kbuild test robot @ 2017-03-06 18:03 UTC (permalink / raw)
  To: Joe Perches
  Cc: kbuild-all, QLogic-Storage-Upstream, James E.J. Bottomley,
	Martin K. Petersen, linux-scsi, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 3654 bytes --]

Hi Joe,

[auto build test WARNING on scsi/for-next]
[also build test WARNING on v4.11-rc1 next-20170306]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Joe-Perches/scsi-qedf-Fix-defective-logging-format-and-argument-mismatches/20170307-005400
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: parisc-allmodconfig (attached as .config)
compiler: hppa-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=parisc 

All warnings (new ones prefixed by >>):

   In file included from drivers/scsi/qedf/qedf.h:28:0,
                    from drivers/scsi/qedf/qedf_main.c:24:
   drivers/scsi/qedf/qedf_main.c: In function 'qedf_alloc_bdq':
>> drivers/scsi/qedf/qedf_main.c:2459:6: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 7 has type 'dma_addr_t {aka unsigned int}' [-Wformat=]
         "BDQ PBL addr=0x%p dma=0x%llx.\n", qedf->bdq_pbl,
         ^
   drivers/scsi/qedf/qedf_dbg.h:82:50: note: in definition of macro 'QEDF_INFO'
      qedf_dbg_info(pdev, __func__, __LINE__, level, fmt, \
                                                     ^~~

vim +2459 drivers/scsi/qedf/qedf_main.c

61d8658b Dupuis, Chad 2017-02-15  2443  	}
61d8658b Dupuis, Chad 2017-02-15  2444  
61d8658b Dupuis, Chad 2017-02-15  2445  	/* Alloc dma memory for BDQ page buffer list */
61d8658b Dupuis, Chad 2017-02-15  2446  	qedf->bdq_pbl_mem_size =
61d8658b Dupuis, Chad 2017-02-15  2447  	    QEDF_BDQ_SIZE * sizeof(struct scsi_bd);
61d8658b Dupuis, Chad 2017-02-15  2448  	qedf->bdq_pbl_mem_size =
61d8658b Dupuis, Chad 2017-02-15  2449  	    ALIGN(qedf->bdq_pbl_mem_size, QEDF_PAGE_SIZE);
61d8658b Dupuis, Chad 2017-02-15  2450  
61d8658b Dupuis, Chad 2017-02-15  2451  	qedf->bdq_pbl = dma_alloc_coherent(&qedf->pdev->dev,
61d8658b Dupuis, Chad 2017-02-15  2452  	    qedf->bdq_pbl_mem_size, &qedf->bdq_pbl_dma, GFP_KERNEL);
61d8658b Dupuis, Chad 2017-02-15  2453  	if (!qedf->bdq_pbl) {
61d8658b Dupuis, Chad 2017-02-15  2454  		QEDF_ERR(&(qedf->dbg_ctx), "Could not allocate BDQ PBL.\n");
61d8658b Dupuis, Chad 2017-02-15  2455  		return -ENOMEM;
61d8658b Dupuis, Chad 2017-02-15  2456  	}
61d8658b Dupuis, Chad 2017-02-15  2457  
61d8658b Dupuis, Chad 2017-02-15  2458  	QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_DISC,
61d8658b Dupuis, Chad 2017-02-15 @2459  	    "BDQ PBL addr=0x%p dma=0x%llx.\n", qedf->bdq_pbl,
61d8658b Dupuis, Chad 2017-02-15  2460  	    qedf->bdq_pbl_dma);
61d8658b Dupuis, Chad 2017-02-15  2461  
61d8658b Dupuis, Chad 2017-02-15  2462  	/*
61d8658b Dupuis, Chad 2017-02-15  2463  	 * Populate BDQ PBL with physical and virtual address of individual
61d8658b Dupuis, Chad 2017-02-15  2464  	 * BDQ buffers
61d8658b Dupuis, Chad 2017-02-15  2465  	 */
61d8658b Dupuis, Chad 2017-02-15  2466  	pbl = (struct scsi_bd *)qedf->bdq_pbl;
61d8658b Dupuis, Chad 2017-02-15  2467  	for (i = 0; i < QEDF_BDQ_SIZE; i++) {

:::::: The code at line 2459 was first introduced by commit
:::::: 61d8658b4a435eac729966cc94cdda077a8df5cd scsi: qedf: Add QLogic FastLinQ offload FCoE driver framework.

:::::: TO: Dupuis, Chad <chad.dupuis@cavium.com>
:::::: CC: Martin K. Petersen <martin.petersen@oracle.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 48585 bytes --]

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

* Re: [PATCH] scsi: qedf: Fix defective logging format and argument mismatches
  2017-03-06 18:03 ` kbuild test robot
@ 2017-03-06 18:17   ` Joe Perches
  2017-03-06 18:33     ` Joe Perches
  0 siblings, 1 reply; 6+ messages in thread
From: Joe Perches @ 2017-03-06 18:17 UTC (permalink / raw)
  To: kbuild test robot
  Cc: kbuild-all, QLogic-Storage-Upstream, James E.J. Bottomley,
	Martin K. Petersen, linux-scsi, linux-kernel

On Tue, 2017-03-07 at 02:03 +0800, kbuild test robot wrote:
> Hi Joe,

Hi again Fengguang's robot.

> [auto build test WARNING on scsi/for-next]
> [also build test WARNING on v4.11-rc1 next-20170306]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
> 
> url:    https://github.com/0day-ci/linux/commits/Joe-Perches/scsi-qedf-Fix-defective-logging-format-and-argument-mismatches/20170307-005400
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
> config: parisc-allmodconfig (attached as .config)
> compiler: hppa-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705

Not new messages.

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

* Re: [PATCH] scsi: qedf: Fix defective logging format and argument mismatches
  2017-03-06 18:17   ` Joe Perches
@ 2017-03-06 18:33     ` Joe Perches
  0 siblings, 0 replies; 6+ messages in thread
From: Joe Perches @ 2017-03-06 18:33 UTC (permalink / raw)
  To: kbuild test robot
  Cc: kbuild-all, QLogic-Storage-Upstream, James E.J. Bottomley,
	Martin K. Petersen, linux-scsi, linux-kernel

On Mon, 2017-03-06 at 10:17 -0800, Joe Perches wrote:
> On Tue, 2017-03-07 at 02:03 +0800, kbuild test robot wrote:
> > Hi Joe,
> 
> Hi again Fengguang's robot.

Rehi.  OK, it is a new message.  Patch sent.

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

* Re: [PATCH] scsi: qedf: Fix defective logging format and argument mismatches
  2017-03-04  8:07 [PATCH] scsi: qedf: Fix defective logging format and argument mismatches Joe Perches
  2017-03-06 17:52 ` kbuild test robot
  2017-03-06 18:03 ` kbuild test robot
@ 2017-03-06 19:33 ` Chad Dupuis
  2 siblings, 0 replies; 6+ messages in thread
From: Chad Dupuis @ 2017-03-06 19:33 UTC (permalink / raw)
  To: Joe Perches
  Cc: QLogic-Storage-Upstream, James E.J. Bottomley,
	Martin K. Petersen, linux-scsi, linux-kernel


On Sat, 4 Mar 2017, 8:07am -0000, Joe Perches wrote:

> Add __printf compiler verification of format and arguments.
> Fix fallout.
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  drivers/scsi/qedf/qedf_dbg.h | 13 ++++++++-----
>  drivers/scsi/qedf/qedf_fip.c |  2 +-
>  drivers/scsi/qedf/qedf_io.c  |  4 ++--
>  3 files changed, 11 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/scsi/qedf/qedf_dbg.h b/drivers/scsi/qedf/qedf_dbg.h

Thanks.

Acked-by: Chad Dupuis <chad.dupuis@cavium.com>

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

end of thread, other threads:[~2017-03-06 19:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-04  8:07 [PATCH] scsi: qedf: Fix defective logging format and argument mismatches Joe Perches
2017-03-06 17:52 ` kbuild test robot
2017-03-06 18:03 ` kbuild test robot
2017-03-06 18:17   ` Joe Perches
2017-03-06 18:33     ` Joe Perches
2017-03-06 19:33 ` Chad Dupuis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.