drivers/dma/iop-adma.c cast build warnings

From: Randy Dunlap
Date: Mon Apr 20 2020 - 20:26:08 EST


Hi,

On i386, when CONFIG_ARCH_DMA_ADDR_T_64BIT=y,
but long and void* are only 32 bits, there are a few build warnings:

CC [M] drivers/dma/iop-adma.o
../drivers/dma/iop-adma.c: In function 'iop_adma_alloc_chan_resources':
../drivers/dma/iop-adma.c:448:13: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
hw_desc = (char *) iop_chan->device->dma_desc_pool;
^
../drivers/dma/iop-adma.c:450:4: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
(dma_addr_t) &hw_desc[idx * IOP_ADMA_SLOT_SIZE];
^
In file included from ../include/linux/printk.h:328:0,
from ../include/linux/kernel.h:15,
from ../include/linux/list.h:9,
from ../include/linux/module.h:12,
from ../drivers/dma/iop-adma.c:13:
../drivers/dma/iop-adma.c: In function 'iop_adma_probe':
../drivers/dma/iop-adma.c:1302:3: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
(void *) adev->dma_desc_pool);
^

This is on linux-next 20200420.

Are DMA addresses for this driver/hw device limited to 32 bits?

thanks.
--
~Randy
Reported-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>