summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/hp
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2016-01-29 12:39:10 +0100
committerDavid S. Miller <davem@davemloft.net>2016-01-29 20:33:38 -0800
commit84092996673211f16ef3b942a191d7952e9dfea9 (patch)
tree58d60a45fc6721159e17b3a1a9b72472f04d7509 /drivers/net/ethernet/hp
parent84922d8cd49c505dc0912f57f4ab1f8f33c7e118 (diff)
downloadlinux-84092996673211f16ef3b942a191d7952e9dfea9.tar.gz
linux-84092996673211f16ef3b942a191d7952e9dfea9.tar.bz2
linux-84092996673211f16ef3b942a191d7952e9dfea9.zip
net: davinci_cpdma: use dma_addr_t for DMA address
The davinci_cpdma mixes up physical addresses as seen from the CPU and DMA addresses as seen from a DMA master, since it can operate on both normal memory or an on-chip buffer. If dma_addr_t is different from phys_addr_t, this means we get a compile-time warning about the type mismatch: ethernet/ti/davinci_cpdma.c: In function 'cpdma_desc_pool_create': ethernet/ti/davinci_cpdma.c:182:48: error: passing argument 3 of 'dma_alloc_coherent' from incompatible pointer type [-Werror=incompatible-pointer-types] pool->cpumap = dma_alloc_coherent(dev, size, &pool->phys, In file included from ethernet/ti/davinci_cpdma.c:21:0: dma-mapping.h:398:21: note: expected 'dma_addr_t * {aka long long unsigned int *}' but argument is of type 'phys_addr_t * {aka unsigned int *}' static inline void *dma_alloc_coherent(struct device *dev, size_t size, This slightly restructures the code so the address we use for mapping RAM into a DMA address is always a dma_addr_t, avoiding the warning. The code is correct even if both types are 32-bit because the DMA master in this device only supports 32-bit addressing anyway, independent of the types that are used. We still assign this value to pool->phys, and that is wrong if the driver is ever used with an IOMMU, but that value appears to be never used, so there is no problem really. I've added a couple of comments about where we do things that are slightly violating the API. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hp')
0 files changed, 0 insertions, 0 deletions