* [PATCH] dmaengine: zynqmp: avoid cast warning
@ 2016-07-11 21:46 Arnd Bergmann
2016-07-12 4:33 ` Vinod Koul
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2016-07-11 21:46 UTC (permalink / raw)
To: Vinod Koul
Cc: Arnd Bergmann, Dan Williams, Michal Simek, Sören Brinkmann,
Kedareswara rao Appana, dmaengine, linux-arm-kernel,
linux-kernel
The newly added zynqmp_dma driver produces a warning on 32-bit architectures
when dma_addr_t is 64-bit wide:
drivers/dma/xilinx/zynqmp_dma.c: In function 'zynqmp_dma_config_sg_ll_desc':
drivers/dma/xilinx/zynqmp_dma.c:321:9: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
((dma_addr_t)sdesc - (dma_addr_t)chan->desc_pool_v);
^
drivers/dma/xilinx/zynqmp_dma.c:321:29: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
((dma_addr_t)sdesc - (dma_addr_t)chan->desc_pool_v);
This changes the cast to the more appropriate uintptr_t.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/dma/xilinx/zynqmp_dma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
index 59bc1f730a48..f777a5bc0db8 100644
--- a/drivers/dma/xilinx/zynqmp_dma.c
+++ b/drivers/dma/xilinx/zynqmp_dma.c
@@ -318,7 +318,7 @@ static void zynqmp_dma_config_sg_ll_desc(struct zynqmp_dma_chan *chan,
if (prev) {
dma_addr_t addr = chan->desc_pool_p +
- ((dma_addr_t)sdesc - (dma_addr_t)chan->desc_pool_v);
+ ((uintptr_t)sdesc - (uintptr_t)chan->desc_pool_v);
ddesc = prev + 1;
prev->nxtdscraddr = addr;
ddesc->nxtdscraddr = addr + ZYNQMP_DMA_DESC_SIZE(chan);
--
2.9.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] dmaengine: zynqmp: avoid cast warning
2016-07-11 21:46 [PATCH] dmaengine: zynqmp: avoid cast warning Arnd Bergmann
@ 2016-07-12 4:33 ` Vinod Koul
0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2016-07-12 4:33 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Dan Williams, Michal Simek, Sören Brinkmann,
Kedareswara rao Appana, dmaengine, linux-arm-kernel,
linux-kernel
On Mon, Jul 11, 2016 at 11:46:09PM +0200, Arnd Bergmann wrote:
> The newly added zynqmp_dma driver produces a warning on 32-bit architectures
> when dma_addr_t is 64-bit wide:
>
> drivers/dma/xilinx/zynqmp_dma.c: In function 'zynqmp_dma_config_sg_ll_desc':
> drivers/dma/xilinx/zynqmp_dma.c:321:9: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
> ((dma_addr_t)sdesc - (dma_addr_t)chan->desc_pool_v);
> ^
> drivers/dma/xilinx/zynqmp_dma.c:321:29: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
> ((dma_addr_t)sdesc - (dma_addr_t)chan->desc_pool_v);
>
> This changes the cast to the more appropriate uintptr_t.
Applied, thanks
--
~Vinod
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-07-12 4:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-11 21:46 [PATCH] dmaengine: zynqmp: avoid cast warning Arnd Bergmann
2016-07-12 4:33 ` Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).