diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-08-10 12:10:49 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-08-10 12:10:49 +0100 |
commit | 98ed7d4b1a4eebc1ac25929b6968673bef4d54c3 (patch) | |
tree | b9c0e29f20666f433d346c80b557ef0f055336eb /arch/arm/common | |
parent | 492c71dd545a54dc62df8780bd8d233d771748df (diff) | |
download | linux-3.10-98ed7d4b1a4eebc1ac25929b6968673bef4d54c3.tar.gz linux-3.10-98ed7d4b1a4eebc1ac25929b6968673bef4d54c3.tar.bz2 linux-3.10-98ed7d4b1a4eebc1ac25929b6968673bef4d54c3.zip |
[ARM] dma-mapping: improve type-safeness of DMA translations
OMAP at least gets the return type(s) for the DMA translation functions
wrong, which can lead to subtle errors. Avoid this by moving the DMA
translation functions to asm/dma-mapping.h, and converting them to
inline functions.
Fix the OMAP DMA translation macros to use the correct argument and
result types.
Also, remove the unnecessary casts in dmabounce.c.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/common')
-rw-r--r-- | arch/arm/common/dmabounce.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c index 69130f36590..1ea6482cdf6 100644 --- a/arch/arm/common/dmabounce.c +++ b/arch/arm/common/dmabounce.c @@ -246,9 +246,9 @@ map_single(struct device *dev, void *ptr, size_t size, } dev_dbg(dev, - "%s: unsafe buffer %p (phy=%p) mapped to %p (phy=%p)\n", - __func__, buf->ptr, (void *) virt_to_dma(dev, buf->ptr), - buf->safe, (void *) buf->safe_dma_addr); + "%s: unsafe buffer %p (dma=%#x) mapped to %p (dma=%#x)\n", + __func__, buf->ptr, virt_to_dma(dev, buf->ptr), + buf->safe, buf->safe_dma_addr); if ((dir == DMA_TO_DEVICE) || (dir == DMA_BIDIRECTIONAL)) { @@ -292,9 +292,9 @@ unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, BUG_ON(buf->size != size); dev_dbg(dev, - "%s: unsafe buffer %p (phy=%p) mapped to %p (phy=%p)\n", - __func__, buf->ptr, (void *) virt_to_dma(dev, buf->ptr), - buf->safe, (void *) buf->safe_dma_addr); + "%s: unsafe buffer %p (dma=%#x) mapped to %p (dma=%#x)\n", + __func__, buf->ptr, virt_to_dma(dev, buf->ptr), + buf->safe, buf->safe_dma_addr); DO_STATS ( device_info->bounce_count++ ); @@ -355,9 +355,9 @@ sync_single(struct device *dev, dma_addr_t dma_addr, size_t size, */ dev_dbg(dev, - "%s: unsafe buffer %p (phy=%p) mapped to %p (phy=%p)\n", - __func__, buf->ptr, (void *) virt_to_dma(dev, buf->ptr), - buf->safe, (void *) buf->safe_dma_addr); + "%s: unsafe buffer %p (dma=%#x) mapped to %p (dma=%#x)\n", + __func__, buf->ptr, virt_to_dma(dev, buf->ptr), + buf->safe, buf->safe_dma_addr); DO_STATS ( device_info->bounce_count++ ); |