diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-08-10 07:10:49 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-08-10 07:10:49 -0400 |
commit | 98ed7d4b1a4eebc1ac25929b6968673bef4d54c3 (patch) | |
tree | b9c0e29f20666f433d346c80b557ef0f055336eb /arch/arm/common | |
parent | 492c71dd545a54dc62df8780bd8d233d771748df (diff) |
[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 69130f365904..1ea6482cdf6e 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, | |||
246 | } | 246 | } |
247 | 247 | ||
248 | dev_dbg(dev, | 248 | dev_dbg(dev, |
249 | "%s: unsafe buffer %p (phy=%p) mapped to %p (phy=%p)\n", | 249 | "%s: unsafe buffer %p (dma=%#x) mapped to %p (dma=%#x)\n", |
250 | __func__, buf->ptr, (void *) virt_to_dma(dev, buf->ptr), | 250 | __func__, buf->ptr, virt_to_dma(dev, buf->ptr), |
251 | buf->safe, (void *) buf->safe_dma_addr); | 251 | buf->safe, buf->safe_dma_addr); |
252 | 252 | ||
253 | if ((dir == DMA_TO_DEVICE) || | 253 | if ((dir == DMA_TO_DEVICE) || |
254 | (dir == DMA_BIDIRECTIONAL)) { | 254 | (dir == DMA_BIDIRECTIONAL)) { |
@@ -292,9 +292,9 @@ unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, | |||
292 | BUG_ON(buf->size != size); | 292 | BUG_ON(buf->size != size); |
293 | 293 | ||
294 | dev_dbg(dev, | 294 | dev_dbg(dev, |
295 | "%s: unsafe buffer %p (phy=%p) mapped to %p (phy=%p)\n", | 295 | "%s: unsafe buffer %p (dma=%#x) mapped to %p (dma=%#x)\n", |
296 | __func__, buf->ptr, (void *) virt_to_dma(dev, buf->ptr), | 296 | __func__, buf->ptr, virt_to_dma(dev, buf->ptr), |
297 | buf->safe, (void *) buf->safe_dma_addr); | 297 | buf->safe, buf->safe_dma_addr); |
298 | 298 | ||
299 | DO_STATS ( device_info->bounce_count++ ); | 299 | DO_STATS ( device_info->bounce_count++ ); |
300 | 300 | ||
@@ -355,9 +355,9 @@ sync_single(struct device *dev, dma_addr_t dma_addr, size_t size, | |||
355 | */ | 355 | */ |
356 | 356 | ||
357 | dev_dbg(dev, | 357 | dev_dbg(dev, |
358 | "%s: unsafe buffer %p (phy=%p) mapped to %p (phy=%p)\n", | 358 | "%s: unsafe buffer %p (dma=%#x) mapped to %p (dma=%#x)\n", |
359 | __func__, buf->ptr, (void *) virt_to_dma(dev, buf->ptr), | 359 | __func__, buf->ptr, virt_to_dma(dev, buf->ptr), |
360 | buf->safe, (void *) buf->safe_dma_addr); | 360 | buf->safe, buf->safe_dma_addr); |
361 | 361 | ||
362 | DO_STATS ( device_info->bounce_count++ ); | 362 | DO_STATS ( device_info->bounce_count++ ); |
363 | 363 | ||