diff options
author | Robin Murphy <robin.murphy@arm.com> | 2015-10-27 13:40:26 -0400 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2015-10-29 12:58:00 -0400 |
commit | 86a5906e4d1df1ec160fa9e18b6f2277a5216c60 (patch) | |
tree | 7b5dc8e5b7b8e4f1b686f5a35850f4194d5c8201 | |
parent | 5accd17d0eb523350c9ef754d655e379c9bb93b3 (diff) |
arm64: Fix build with CONFIG_ZONE_DMA=n
Trying to build with CONFIG_ZONE_DMA=n leaves visible references
to the now-undefined ZONE_DMA, resulting in a syntax error.
Hide the references behind an #ifdef instead of using IS_ENABLED.
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
-rw-r--r-- | arch/arm64/mm/init.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 7a1f9a05dc82..17bf39ac83ba 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c | |||
@@ -86,10 +86,10 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max) | |||
86 | memset(zone_size, 0, sizeof(zone_size)); | 86 | memset(zone_size, 0, sizeof(zone_size)); |
87 | 87 | ||
88 | /* 4GB maximum for 32-bit only capable devices */ | 88 | /* 4GB maximum for 32-bit only capable devices */ |
89 | if (IS_ENABLED(CONFIG_ZONE_DMA)) { | 89 | #ifdef CONFIG_ZONE_DMA |
90 | max_dma = PFN_DOWN(arm64_dma_phys_limit); | 90 | max_dma = PFN_DOWN(arm64_dma_phys_limit); |
91 | zone_size[ZONE_DMA] = max_dma - min; | 91 | zone_size[ZONE_DMA] = max_dma - min; |
92 | } | 92 | #endif |
93 | zone_size[ZONE_NORMAL] = max - max_dma; | 93 | zone_size[ZONE_NORMAL] = max - max_dma; |
94 | 94 | ||
95 | memcpy(zhole_size, zone_size, sizeof(zhole_size)); | 95 | memcpy(zhole_size, zone_size, sizeof(zhole_size)); |
@@ -101,11 +101,12 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max) | |||
101 | if (start >= max) | 101 | if (start >= max) |
102 | continue; | 102 | continue; |
103 | 103 | ||
104 | if (IS_ENABLED(CONFIG_ZONE_DMA) && start < max_dma) { | 104 | #ifdef CONFIG_ZONE_DMA |
105 | if (start < max_dma) { | ||
105 | unsigned long dma_end = min(end, max_dma); | 106 | unsigned long dma_end = min(end, max_dma); |
106 | zhole_size[ZONE_DMA] -= dma_end - start; | 107 | zhole_size[ZONE_DMA] -= dma_end - start; |
107 | } | 108 | } |
108 | 109 | #endif | |
109 | if (end > max_dma) { | 110 | if (end > max_dma) { |
110 | unsigned long normal_end = min(end, max); | 111 | unsigned long normal_end = min(end, max); |
111 | unsigned long normal_start = max(start, max_dma); | 112 | unsigned long normal_start = max(start, max_dma); |