diff mbox

[2/3] dmaengine: sh: fix print specifier warnings

Message ID 1401682704-32204-2-git-send-email-vinod.koul@intel.com (mailing list archive)
State Accepted
Commit 9d9f71a80431
Delegated to: Vinod Koul
Headers show

Commit Message

Vinod Koul June 2, 2014, 4:18 a.m. UTC
As documented in Documentation/printk-formats.txt we should use %zu/%zx
specifiers for size_t type variables for the code to compile on different
architectures. This is uncovered as COMPILE_TEST has been enabled recently for
this driver

   drivers/dma/sh/shdma-base.c: In function 'shdma_prep_dma_cyclic':
>> drivers/dma/sh/shdma-base.c:683:4: warning: format '%d' expects argument of
>> type 'int', but argument 4 has type 'size_t' [-Wformat=]
       __func__, buf_len, period_len, slave_id);
>> drivers/dma/sh/shdma-base.c:683:4: warning: format '%d' expects argument of
>> type 'int', but argument 5 has type 'size_t' [-Wformat=]

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 drivers/dma/sh/shdma-base.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Laurent Pinchart June 2, 2014, 10:29 a.m. UTC | #1
Hi Vinod,

Thank you for the patch.

On Monday 02 June 2014 09:48:23 Vinod Koul wrote:
> As documented in Documentation/printk-formats.txt we should use %zu/%zx
> specifiers for size_t type variables for the code to compile on different
> architectures. This is uncovered as COMPILE_TEST has been enabled recently
> for this driver
> 
>    drivers/dma/sh/shdma-base.c: In function 'shdma_prep_dma_cyclic':
> >> drivers/dma/sh/shdma-base.c:683:4: warning: format '%d' expects argument
> >> of
> >> type 'int', but argument 4 has type 'size_t' [-Wformat=]
> 
>        __func__, buf_len, period_len, slave_id);
> 
> >> drivers/dma/sh/shdma-base.c:683:4: warning: format '%d' expects argument
> >> of type 'int', but argument 5 has type 'size_t' [-Wformat=]
> 
> Reported-by: kbuild test robot <fengguang.wu@intel.com>
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/dma/sh/shdma-base.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/dma/sh/shdma-base.c b/drivers/dma/sh/shdma-base.c
> index 66b4a35..591b9d8 100644
> --- a/drivers/dma/sh/shdma-base.c
> +++ b/drivers/dma/sh/shdma-base.c
> @@ -679,7 +679,7 @@ static struct dma_async_tx_descriptor
> *shdma_prep_dma_cyclic( /* Someone calling slave DMA on a generic channel?
> */
>  	if (slave_id < 0 || (buf_len < period_len)) {
>  		dev_warn(schan->dev,
> -			"%s: bad parameter: buf_len=%d, period_len=%d, id=%d\n",
> +			"%s: bad parameter: buf_len=%zu, period_len=%zu, id=%d\n",
>  			__func__, buf_len, period_len, slave_id);
>  		return NULL;
>  	}
diff mbox

Patch

diff --git a/drivers/dma/sh/shdma-base.c b/drivers/dma/sh/shdma-base.c
index 66b4a35..591b9d8 100644
--- a/drivers/dma/sh/shdma-base.c
+++ b/drivers/dma/sh/shdma-base.c
@@ -679,7 +679,7 @@  static struct dma_async_tx_descriptor *shdma_prep_dma_cyclic(
 	/* Someone calling slave DMA on a generic channel? */
 	if (slave_id < 0 || (buf_len < period_len)) {
 		dev_warn(schan->dev,
-			"%s: bad parameter: buf_len=%d, period_len=%d, id=%d\n",
+			"%s: bad parameter: buf_len=%zu, period_len=%zu, id=%d\n",
 			__func__, buf_len, period_len, slave_id);
 		return NULL;
 	}