[PATCH] ARM: mm: change further appearance of arm_dma_zone_size tophys_addr_t

From: Russell King
Date: Mon Jan 06 2014 - 16:57:36 EST


The definition was chagned in commit 364230b995214 ("ARM: use phys_addr_t
for DMA zone sizes").

Fixes this build error:

arch/arm/mm/init.c:199:13: error: conflicting types for 'arm_dma_zone_size'
include/linux/bootmem.h:259:11: note: previous declaration of 'arm_dma_zone_size' was here

While changing the type, we also need to limit MAX_DMA_ADDRESS if
PAGE_OFFSET + arm_dma_zone_size is greater than 4GB. The MAX_DMA_ADDRESS
is a virtual address and we really don't want the 32-bit value of
this wrapping.

Cc: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@xxxxxx>
Signed-off-by: Russell King <rmk+kernel@xxxxxxxxxxxxxxxx>
---
arch/arm/include/asm/dma.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/dma.h b/arch/arm/include/asm/dma.h
index 58b8c6a..9908443 100644
--- a/arch/arm/include/asm/dma.h
+++ b/arch/arm/include/asm/dma.h
@@ -8,8 +8,8 @@
#define MAX_DMA_ADDRESS 0xffffffffUL
#else
#define MAX_DMA_ADDRESS ({ \
- extern unsigned long arm_dma_zone_size; \
- arm_dma_zone_size ? \
+ extern phys_addr_t arm_dma_zone_size; \
+ arm_dma_zone_size && arm_dma_zone_size < (0x10000000 - PAGE_OFFSET) ? \
(PAGE_OFFSET + arm_dma_zone_size) : 0xffffffffUL; })
#endif

--
1.7.9.5


--------------000607040405060008010309
Content-Type: text/x-diff;
name="0001-ARM-mm-change-further-appearance-of-arm_dma_zone_siz.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename*0="0001-ARM-mm-change-further-appearance-of-arm_dma_zone_siz.pa";
filename*1="tch"