提交 7cdd3587 编写于 作者: A Arnd Bergmann 提交者: Vinod Koul

dmaengine: zynqmp: avoid cast warning

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: NArnd Bergmann <arnd@arndb.de>
Signed-off-by: NVinod Koul <vinod.koul@intel.com>
上级 e598e6eb
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册