]> git.baikalelectronics.ru Git - kernel.git/commit
davinci_cpdma: don't cast dma_addr_t to pointer
authorArnd Bergmann <arnd@arndb.de>
Wed, 10 Jul 2019 08:00:33 +0000 (10:00 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 12 Jul 2019 22:19:37 +0000 (15:19 -0700)
commitfc298c91bebc44dba865390f856307b67870804c
treea4cde19d457c3d04e0dbb7a0807da4345fb9e25e
parentd3e7054ea3459759b4611725f46fbccf622e07b6
davinci_cpdma: don't cast dma_addr_t to pointer

dma_addr_t may be 64-bit wide on 32-bit architectures, so it is not
valid to cast between it and a pointer:

drivers/net/ethernet/ti/davinci_cpdma.c: In function 'cpdma_chan_submit_si':
drivers/net/ethernet/ti/davinci_cpdma.c:1047:12: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
drivers/net/ethernet/ti/davinci_cpdma.c: In function 'cpdma_chan_idle_submit_mapped':
drivers/net/ethernet/ti/davinci_cpdma.c:1114:12: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
drivers/net/ethernet/ti/davinci_cpdma.c: In function 'cpdma_chan_submit_mapped':
drivers/net/ethernet/ti/davinci_cpdma.c:1164:12: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]

Solve this by using two separate members in 'struct submit_info'.
Since this avoids the use of the 'flag' member, the structure does
not even grow in typical configurations.

Fixes: a2b1d1e14a24 ("net: ethernet: ti: davinci_cpdma: add dma mapped submit")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/davinci_cpdma.c