Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1588938 > unrolled thread

[PATCH] scsi: lpfc: use proper format string for dma_addr_t

Started byArnd Bergmann <arnd@arndb.de>
First post2017-02-27 21:50 +0100
Last post2017-02-28 22:20 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] scsi: lpfc: use proper format string for dma_addr_t Arnd Bergmann <arnd@arndb.de> - 2017-02-27 21:50 +0100
    Re: [PATCH] scsi: lpfc: use proper format string for dma_addr_t "Martin K. Petersen" <martin.petersen@oracle.com> - 2017-02-28 04:20 +0100
    Re: [PATCH] scsi: lpfc: use proper format string for dma_addr_t James Smart <james.smart@broadcom.com> - 2017-02-28 22:20 +0100

#1588938 — [PATCH] scsi: lpfc: use proper format string for dma_addr_t

FromArnd Bergmann <arnd@arndb.de>
Date2017-02-27 21:50 +0100
Subject[PATCH] scsi: lpfc: use proper format string for dma_addr_t
Message-ID<tfAp4-2r5-31@gated-at.bofh.it>
dma_addr_t may be either u32 or u64, depending on the kernel configuration,
and we get a warning for the 32-bit case:

drivers/scsi/lpfc/lpfc_nvme.c: In function 'lpfc_nvme_ls_req':
drivers/scsi/lpfc/lpfc_logmsg.h:52:52: error: format '%llu' expects argument of type 'long long unsigned int', but argument 11 has type 'dma_addr_t {aka unsigned int}' [-Werror=format=]
drivers/scsi/lpfc/lpfc_logmsg.h:52:52: error: format '%llu' expects argument of type 'long long unsigned int', but argument 12 has type 'dma_addr_t {aka unsigned int}' [-Werror=format=]
drivers/scsi/lpfc/lpfc_nvme.c: In function 'lpfc_nvme_ls_abort':
drivers/scsi/lpfc/lpfc_logmsg.h:52:52: error: format '%llu' expects argument of type 'long long unsigned int', but argument 11 has type 'dma_addr_t {aka unsigned int}' [-Werror=format=]
drivers/scsi/lpfc/lpfc_logmsg.h:52:52: error: format '%llu' expects argument of type 'long long unsigned int', but argument 12 has type 'dma_addr_t {aka unsigned int}' [-Werror=format=]

printk has a special "%pad" format string that passes the dma address by
reference to solve this problem.

Fixes: 01649561a8b4 ("scsi: lpfc: NVME Initiator: bind to nvme_fc api")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/scsi/lpfc/lpfc_nvme.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c
index 625b6589a34d..609a908ea9db 100644
--- a/drivers/scsi/lpfc/lpfc_nvme.c
+++ b/drivers/scsi/lpfc/lpfc_nvme.c
@@ -457,11 +457,11 @@ lpfc_nvme_ls_req(struct nvme_fc_local_port *pnvme_lport,
 	/* Expand print to include key fields. */
 	lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME_DISC,
 			 "6051 ENTER.  lport %p, rport %p lsreq%p rqstlen:%d "
-			 "rsplen:%d %llux %llux\n",
+			 "rsplen:%d %pad %pad\n",
 			 pnvme_lport, pnvme_rport,
 			 pnvme_lsreq, pnvme_lsreq->rqstlen,
-			 pnvme_lsreq->rsplen, pnvme_lsreq->rqstdma,
-			 pnvme_lsreq->rspdma);
+			 pnvme_lsreq->rsplen, &pnvme_lsreq->rqstdma,
+			 &pnvme_lsreq->rspdma);
 
 	vport->phba->fc4NvmeLsRequests++;
 
@@ -527,11 +527,11 @@ lpfc_nvme_ls_abort(struct nvme_fc_local_port *pnvme_lport,
 	/* Expand print to include key fields. */
 	lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME_ABTS,
 			 "6040 ENTER.  lport %p, rport %p lsreq %p rqstlen:%d "
-			 "rsplen:%d %llux %llux\n",
+			 "rsplen:%d %pad %pad\n",
 			 pnvme_lport, pnvme_rport,
 			 pnvme_lsreq, pnvme_lsreq->rqstlen,
-			 pnvme_lsreq->rsplen, pnvme_lsreq->rqstdma,
-			 pnvme_lsreq->rspdma);
+			 pnvme_lsreq->rsplen, &pnvme_lsreq->rqstdma,
+			 &pnvme_lsreq->rspdma);
 
 	/*
 	 * Lock the ELS ring txcmplq and build a local list of all ELS IOs
-- 
2.9.0

[toc] | [next] | [standalone]


#1589139

From"Martin K. Petersen" <martin.petersen@oracle.com>
Date2017-02-28 04:20 +0100
Message-ID<tfGut-6Vv-3@gated-at.bofh.it>
In reply to#1588938
>>>>> "Arnd" == Arnd Bergmann <arnd@arndb.de> writes:

Arnd> dma_addr_t may be either u32 or u64, depending on the kernel
Arnd> configuration, and we get a warning for the 32-bit case:

Applied to 4.11/scsi-fixes.

-- 
Martin K. Petersen	Oracle Linux Engineering

[toc] | [prev] | [next] | [standalone]


#1589785

FromJames Smart <james.smart@broadcom.com>
Date2017-02-28 22:20 +0100
Message-ID<tfXlE-1rB-27@gated-at.bofh.it>
In reply to#1588938
Arnd,

Thank you. Looks good.

-- james

Signed-off-by: James Smart <james.smart@broadcom.com>


On 2/27/2017 12:37 PM, Arnd Bergmann wrote:
> dma_addr_t may be either u32 or u64, depending on the kernel configuration,
> and we get a warning for the 32-bit case:
>
> drivers/scsi/lpfc/lpfc_nvme.c: In function 'lpfc_nvme_ls_req':
> drivers/scsi/lpfc/lpfc_logmsg.h:52:52: error: format '%llu' expects argument of type 'long long unsigned int', but argument 11 has type 'dma_addr_t {aka unsigned int}' [-Werror=format=]
> drivers/scsi/lpfc/lpfc_logmsg.h:52:52: error: format '%llu' expects argument of type 'long long unsigned int', but argument 12 has type 'dma_addr_t {aka unsigned int}' [-Werror=format=]
> drivers/scsi/lpfc/lpfc_nvme.c: In function 'lpfc_nvme_ls_abort':
> drivers/scsi/lpfc/lpfc_logmsg.h:52:52: error: format '%llu' expects argument of type 'long long unsigned int', but argument 11 has type 'dma_addr_t {aka unsigned int}' [-Werror=format=]
> drivers/scsi/lpfc/lpfc_logmsg.h:52:52: error: format '%llu' expects argument of type 'long long unsigned int', but argument 12 has type 'dma_addr_t {aka unsigned int}' [-Werror=format=]
>
> printk has a special "%pad" format string that passes the dma address by
> reference to solve this problem.
>
> Fixes: 01649561a8b4 ("scsi: lpfc: NVME Initiator: bind to nvme_fc api")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>   drivers/scsi/lpfc/lpfc_nvme.c | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c
> index 625b6589a34d..609a908ea9db 100644
> --- a/drivers/scsi/lpfc/lpfc_nvme.c
> +++ b/drivers/scsi/lpfc/lpfc_nvme.c
> @@ -457,11 +457,11 @@ lpfc_nvme_ls_req(struct nvme_fc_local_port *pnvme_lport,
>   	/* Expand print to include key fields. */
>   	lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME_DISC,
>   			 "6051 ENTER.  lport %p, rport %p lsreq%p rqstlen:%d "
> -			 "rsplen:%d %llux %llux\n",
> +			 "rsplen:%d %pad %pad\n",
>   			 pnvme_lport, pnvme_rport,
>   			 pnvme_lsreq, pnvme_lsreq->rqstlen,
> -			 pnvme_lsreq->rsplen, pnvme_lsreq->rqstdma,
> -			 pnvme_lsreq->rspdma);
> +			 pnvme_lsreq->rsplen, &pnvme_lsreq->rqstdma,
> +			 &pnvme_lsreq->rspdma);
>   
>   	vport->phba->fc4NvmeLsRequests++;
>   
> @@ -527,11 +527,11 @@ lpfc_nvme_ls_abort(struct nvme_fc_local_port *pnvme_lport,
>   	/* Expand print to include key fields. */
>   	lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME_ABTS,
>   			 "6040 ENTER.  lport %p, rport %p lsreq %p rqstlen:%d "
> -			 "rsplen:%d %llux %llux\n",
> +			 "rsplen:%d %pad %pad\n",
>   			 pnvme_lport, pnvme_rport,
>   			 pnvme_lsreq, pnvme_lsreq->rqstlen,
> -			 pnvme_lsreq->rsplen, pnvme_lsreq->rqstdma,
> -			 pnvme_lsreq->rspdma);
> +			 pnvme_lsreq->rsplen, &pnvme_lsreq->rqstdma,
> +			 &pnvme_lsreq->rspdma);
>   
>   	/*
>   	 * Lock the ELS ring txcmplq and build a local list of all ELS IOs

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web