diff mbox

scsi: qedf: Use vsprintf extension %pad

Message ID f6a0331e574df0ab1c9dad61571b92c17971ae99.1488825093.git.joe@perches.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Joe Perches March 6, 2017, 6:32 p.m. UTC
Using %llx for a dma_addr_t can lead to format/argument mismatches.
Use %pad and the address of the dma_addr_t instead.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/scsi/qedf/qedf_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Dupuis, Chad March 6, 2017, 7:34 p.m. UTC | #1
On Mon, 6 Mar 2017, 6:32pm -0000, Joe Perches wrote:

> Using %llx for a dma_addr_t can lead to format/argument mismatches.
> Use %pad and the address of the dma_addr_t instead.
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  drivers/scsi/qedf/qedf_main.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
> index d9d7a86b5f8b..8e2a160490e6 100644
> --- a/drivers/scsi/qedf/qedf_main.c
> +++ b/drivers/scsi/qedf/qedf_main.c
> @@ -2456,8 +2456,8 @@ static int qedf_alloc_bdq(struct qedf_ctx *qedf)
>  	}
>  
>  	QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_DISC,
> -	    "BDQ PBL addr=0x%p dma=0x%llx.\n", qedf->bdq_pbl,
> -	    qedf->bdq_pbl_dma);
> +		  "BDQ PBL addr=0x%p dma=%pad\n",
> +		  qedf->bdq_pbl, &qedf->bdq_pbl_dma);
>  
>  	/*
>  	 * Populate BDQ PBL with physical and virtual address of individual
> 

Looks good.

Acked-by: Chad Dupuis <chad.dupuis@cavium.com>
Martin K. Petersen March 7, 2017, 3:39 a.m. UTC | #2
>>>>> "Joe" == Joe Perches <joe@perches.com> writes:

Joe> Using %llx for a dma_addr_t can lead to format/argument mismatches.
Joe> Use %pad and the address of the dma_addr_t instead.

Applied to 4.11/scsi-fixes.
diff mbox

Patch

diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index d9d7a86b5f8b..8e2a160490e6 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -2456,8 +2456,8 @@  static int qedf_alloc_bdq(struct qedf_ctx *qedf)
 	}
 
 	QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_DISC,
-	    "BDQ PBL addr=0x%p dma=0x%llx.\n", qedf->bdq_pbl,
-	    qedf->bdq_pbl_dma);
+		  "BDQ PBL addr=0x%p dma=%pad\n",
+		  qedf->bdq_pbl, &qedf->bdq_pbl_dma);
 
 	/*
 	 * Populate BDQ PBL with physical and virtual address of individual