All of lore.kernel.org
 help / color / mirror / Atom feed
From: vinod.koul@intel.com (Vinod Koul)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] dmaengine: at_hdmac: fix dma_addr_t printing
Date: Tue, 8 Dec 2015 21:48:38 +0530	[thread overview]
Message-ID: <20151208161838.GS1854@localhost> (raw)
In-Reply-To: <24590899.3e2244jrdI@wuerfel>

On Tue, Dec 08, 2015 at 04:34:28PM +0100, Arnd Bergmann wrote:
> A recent patch tried to improve the printk output of the atc_dump_lli()
> function but introduced a bug, in which we end up dereferencing a
> dma address as a pointer, and we even get a warning for it:
> 
> drivers/dma/at_hdmac_regs.h: In function 'atc_dump_lli':
> drivers/dma/at_hdmac_regs.h:388:4: warning: format '%p' expects argument of type 'void *', but argument 3 has type 'dma_addr_t {aka long long unsigned int}' [-Wformat=]
> 
> This changes the code to pass the DMA address by reference, as expected
> by printk.

Thanks for this but i was planning to drop 096117032a36 "dmaengine: do not
use 0x in front of %pad" as recomended by Dmitry, so we should fix this
cleanly

I will push out updated tree in a short while...

> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 096117032a36 ("dmaengine: do not use 0x in front of %pad")
> ---
>  drivers/dma/at_hdmac_regs.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/dma/at_hdmac_regs.h b/drivers/dma/at_hdmac_regs.h
> index 610907dbc11a..0474e4a0f02a 100644
> --- a/drivers/dma/at_hdmac_regs.h
> +++ b/drivers/dma/at_hdmac_regs.h
> @@ -386,8 +386,8 @@ static void atc_dump_lli(struct at_dma_chan *atchan, struct at_lli *lli)
>  {
>  	dev_crit(chan2dev(&atchan->chan_common),
>  		 "  desc: s%pad d%pad ctrl0x%x:0x%x l%pad\n",
> -		 lli->saddr, lli->daddr,
> -		 lli->ctrla, lli->ctrlb, lli->dscr);
> +		 &lli->saddr, &lli->daddr,
> +		 lli->ctrla, lli->ctrlb, &lli->dscr);
>  }
>  
>  
> -- 
> 2.1.0.rc2
> 
> 

-- 
~Vinod

WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vinod.koul@intel.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "Dmitry V. Krivenok" <krivenok.dmitry@gmail.com>,
	Nicolas Ferre <nicolas.ferre@atmel.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Dan Williams <dan.j.williams@intel.com>,
	dmaengine@vger.kernel.org
Subject: Re: [PATCH] dmaengine: at_hdmac: fix dma_addr_t printing
Date: Tue, 8 Dec 2015 21:48:38 +0530	[thread overview]
Message-ID: <20151208161838.GS1854@localhost> (raw)
In-Reply-To: <24590899.3e2244jrdI@wuerfel>

On Tue, Dec 08, 2015 at 04:34:28PM +0100, Arnd Bergmann wrote:
> A recent patch tried to improve the printk output of the atc_dump_lli()
> function but introduced a bug, in which we end up dereferencing a
> dma address as a pointer, and we even get a warning for it:
> 
> drivers/dma/at_hdmac_regs.h: In function 'atc_dump_lli':
> drivers/dma/at_hdmac_regs.h:388:4: warning: format '%p' expects argument of type 'void *', but argument 3 has type 'dma_addr_t {aka long long unsigned int}' [-Wformat=]
> 
> This changes the code to pass the DMA address by reference, as expected
> by printk.

Thanks for this but i was planning to drop 096117032a36 "dmaengine: do not
use 0x in front of %pad" as recomended by Dmitry, so we should fix this
cleanly

I will push out updated tree in a short while...

> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 096117032a36 ("dmaengine: do not use 0x in front of %pad")
> ---
>  drivers/dma/at_hdmac_regs.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/dma/at_hdmac_regs.h b/drivers/dma/at_hdmac_regs.h
> index 610907dbc11a..0474e4a0f02a 100644
> --- a/drivers/dma/at_hdmac_regs.h
> +++ b/drivers/dma/at_hdmac_regs.h
> @@ -386,8 +386,8 @@ static void atc_dump_lli(struct at_dma_chan *atchan, struct at_lli *lli)
>  {
>  	dev_crit(chan2dev(&atchan->chan_common),
>  		 "  desc: s%pad d%pad ctrl0x%x:0x%x l%pad\n",
> -		 lli->saddr, lli->daddr,
> -		 lli->ctrla, lli->ctrlb, lli->dscr);
> +		 &lli->saddr, &lli->daddr,
> +		 lli->ctrla, lli->ctrlb, &lli->dscr);
>  }
>  
>  
> -- 
> 2.1.0.rc2
> 
> 

-- 
~Vinod

  parent reply	other threads:[~2015-12-08 16:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-08 15:34 [PATCH] dmaengine: at_hdmac: fix dma_addr_t printing Arnd Bergmann
2015-12-08 15:34 ` Arnd Bergmann
2015-12-08 16:04 ` Nicolas Ferre
2015-12-08 16:04   ` Nicolas Ferre
2015-12-08 16:23   ` Dmitry Krivenok
2015-12-08 16:23     ` Dmitry Krivenok
2015-12-08 16:18 ` Vinod Koul [this message]
2015-12-08 16:18   ` Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151208161838.GS1854@localhost \
    --to=vinod.koul@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.