Browse Source

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>
Robin Murphy 10 years ago
parent
commit
86a5906e4d
1 changed files with 7 additions and 6 deletions
  1. 7 6
      arch/arm64/mm/init.c

+ 7 - 6
arch/arm64/mm/init.c

@@ -86,10 +86,10 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max)
 	memset(zone_size, 0, sizeof(zone_size));
 	memset(zone_size, 0, sizeof(zone_size));
 
 
 	/* 4GB maximum for 32-bit only capable devices */
 	/* 4GB maximum for 32-bit only capable devices */
-	if (IS_ENABLED(CONFIG_ZONE_DMA)) {
-		max_dma = PFN_DOWN(arm64_dma_phys_limit);
-		zone_size[ZONE_DMA] = max_dma - min;
-	}
+#ifdef CONFIG_ZONE_DMA
+	max_dma = PFN_DOWN(arm64_dma_phys_limit);
+	zone_size[ZONE_DMA] = max_dma - min;
+#endif
 	zone_size[ZONE_NORMAL] = max - max_dma;
 	zone_size[ZONE_NORMAL] = max - max_dma;
 
 
 	memcpy(zhole_size, zone_size, sizeof(zhole_size));
 	memcpy(zhole_size, zone_size, sizeof(zhole_size));
@@ -101,11 +101,12 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max)
 		if (start >= max)
 		if (start >= max)
 			continue;
 			continue;
 
 
-		if (IS_ENABLED(CONFIG_ZONE_DMA) && start < max_dma) {
+#ifdef CONFIG_ZONE_DMA
+		if (start < max_dma) {
 			unsigned long dma_end = min(end, max_dma);
 			unsigned long dma_end = min(end, max_dma);
 			zhole_size[ZONE_DMA] -= dma_end - start;
 			zhole_size[ZONE_DMA] -= dma_end - start;
 		}
 		}
-
+#endif
 		if (end > max_dma) {
 		if (end > max_dma) {
 			unsigned long normal_end = min(end, max);
 			unsigned long normal_end = min(end, max);
 			unsigned long normal_start = max(start, max_dma);
 			unsigned long normal_start = max(start, max_dma);