diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2007-02-06 12:39:31 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2007-02-08 09:49:44 -0500 |
commit | 7ae5a761d2ffc4cf7d3248e09f4d3da234434f30 (patch) | |
tree | 8b936e37b9750c27e8f2c86318591912dc7e1cc3 /arch/arm/mm/consistent.c | |
parent | 953233dc9958ba2b29753d0f24e37a33a076a5f6 (diff) |
[ARM] Convert DMA cache handling to take const void * args
The DMA cache handling functions take virtual addresses, but in the
form of unsigned long arguments. This leads to a little confusion
about what exactly they take. So, convert them to take const void *
instead.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/consistent.c')
-rw-r--r-- | arch/arm/mm/consistent.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/arch/arm/mm/consistent.c b/arch/arm/mm/consistent.c index 83bd035c7d5e..166aee13c4b1 100644 --- a/arch/arm/mm/consistent.c +++ b/arch/arm/mm/consistent.c | |||
@@ -205,10 +205,10 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp, | |||
205 | * kernel direct-mapped region for device DMA. | 205 | * kernel direct-mapped region for device DMA. |
206 | */ | 206 | */ |
207 | { | 207 | { |
208 | unsigned long kaddr = (unsigned long)page_address(page); | 208 | void *ptr = page_address(page); |
209 | memset(page_address(page), 0, size); | 209 | memset(ptr, 0, size); |
210 | dmac_flush_range(kaddr, kaddr + size); | 210 | dmac_flush_range(ptr, ptr + size); |
211 | outer_flush_range(__pa(kaddr), __pa(kaddr) + size); | 211 | outer_flush_range(__pa(ptr), __pa(ptr) + size); |
212 | } | 212 | } |
213 | 213 | ||
214 | /* | 214 | /* |
@@ -481,10 +481,9 @@ core_initcall(consistent_init); | |||
481 | * platforms with CONFIG_DMABOUNCE. | 481 | * platforms with CONFIG_DMABOUNCE. |
482 | * Use the driver DMA support - see dma-mapping.h (dma_sync_*) | 482 | * Use the driver DMA support - see dma-mapping.h (dma_sync_*) |
483 | */ | 483 | */ |
484 | void consistent_sync(void *vaddr, size_t size, int direction) | 484 | void consistent_sync(const void *start, size_t size, int direction) |
485 | { | 485 | { |
486 | unsigned long start = (unsigned long)vaddr; | 486 | const void *end = start + size; |
487 | unsigned long end = start + size; | ||
488 | 487 | ||
489 | BUG_ON(!virt_addr_valid(start) || !virt_addr_valid(end)); | 488 | BUG_ON(!virt_addr_valid(start) || !virt_addr_valid(end)); |
490 | 489 | ||