Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5f03c399 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Vinod Koul
Browse files

dmaengine: k3dma: use correct format string for debug output



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: default avatarArnd Bergmann <arnd@arndb.de>
Fixes: a7e08fa6 ("k3dma: Add cyclic mode for audio")
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent e39a2329
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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)