All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dmaengine: k3dma: use correct format string for debug output
@ 2016-09-06 13:17 Arnd Bergmann
  2016-09-07  8:12 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2016-09-06 13:17 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Arnd Bergmann, Dan Williams, Zhangfei Gao, John Stultz,
	Andy Green, Peter Griffin, Wei Yongjun, dmaengine, linux-kernel

The newly added k3_dma_prep_dma_cyclic function has some debug output
that uses incorrect typecasts, some of which cause a warning like:

drivers/dma/k3dma.c: In function 'k3_dma_prep_dma_cyclic':
drivers/dma/k3dma.c:589:671: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]

In general, we have to print 'dma_addr_t' values using special
'%pad' format to get the correct behavior on kernels that have
a 64-bit dma_addr_t type but 32-bit pointers.

Similarly, printing size_t values should be done using the %z
modifier to get the correct behavior on 64-bit kernels.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: a7e08fa6cc78 ("k3dma: Add cyclic mode for audio")
---
 drivers/dma/k3dma.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/k3dma.c b/drivers/dma/k3dma.c
index 814e6e04e15c..aabcb7934b05 100644
--- a/drivers/dma/k3dma.c
+++ b/drivers/dma/k3dma.c
@@ -586,9 +586,9 @@ k3_dma_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr,
 	size_t modulo = DMA_CYCLIC_MAX_PERIOD;
 	u32 en_tc2 = 0;
 
-	dev_dbg(chan->device->dev, "%s: buf %p, dst %p, buf len %d, period_len = %d, dir %d\n",
-	       __func__, (void *)buf_addr, (void *)to_k3_chan(chan)->dev_addr,
-	       (int)buf_len, (int)period_len, (int)dir);
+	dev_dbg(chan->device->dev, "%s: buf %pad, dst %pad, buf len %zu, period_len = %zu, dir %d\n",
+	       __func__, &buf_addr, &to_k3_chan(chan)->dev_addr,
+	       buf_len, period_len, (int)dir);
 
 	avail = buf_len;
 	if (avail > modulo)
-- 
2.9.0

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

* Re: [PATCH] dmaengine: k3dma: use correct format string for debug output
  2016-09-06 13:17 [PATCH] dmaengine: k3dma: use correct format string for debug output Arnd Bergmann
@ 2016-09-07  8:12 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2016-09-07  8:12 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Dan Williams, Zhangfei Gao, John Stultz, Andy Green,
	Peter Griffin, Wei Yongjun, dmaengine, linux-kernel

On Tue, Sep 06, 2016 at 03:17:49PM +0200, Arnd Bergmann wrote:
> The newly added k3_dma_prep_dma_cyclic function has some debug output
> that uses incorrect typecasts, some of which cause a warning like:
> 
> drivers/dma/k3dma.c: In function 'k3_dma_prep_dma_cyclic':
> drivers/dma/k3dma.c:589:671: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
> 
> In general, we have to print 'dma_addr_t' values using special
> '%pad' format to get the correct behavior on kernels that have
> a 64-bit dma_addr_t type but 32-bit pointers.
> 
> Similarly, printing size_t values should be done using the %z
> modifier to get the correct behavior on 64-bit kernels.

Applied both, thanks


-- 
~Vinod

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

end of thread, other threads:[~2016-09-07  8:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-06 13:17 [PATCH] dmaengine: k3dma: use correct format string for debug output Arnd Bergmann
2016-09-07  8:12 ` Vinod Koul

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.