linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] arm64: mm: Fix unused variable warning in zone_sizes_init
@ 2019-10-15 22:43 Nathan Chancellor
  2019-10-16  3:00 ` Will Deacon
  2019-10-16  3:11 ` [PATCH -next v2] " Nathan Chancellor
  0 siblings, 2 replies; 10+ messages in thread
From: Nathan Chancellor @ 2019-10-15 22:43 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon
  Cc: Nicolas Saenz Julienne, linux-arm-kernel, linux-kernel,
	Nathan Chancellor

When building arm64 allnoconfig, CONFIG_ZONE_DMA and CONFIG_ZONE_DMA32
get disabled so there is a warning about max_dma being unused.

../arch/arm64/mm/init.c:215:16: warning: unused variable 'max_dma'
[-Wunused-variable]
        unsigned long max_dma = min;
                      ^
1 warning generated.

Add an ifdef around the variable to fix this.

Fixes: 1a8e1cef7603 ("arm64: use both ZONE_DMA and ZONE_DMA32")
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---
 arch/arm64/mm/init.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index 44f07fdf7a59..c3d6657b9942 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -212,7 +212,9 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max)
 	struct memblock_region *reg;
 	unsigned long zone_size[MAX_NR_ZONES], zhole_size[MAX_NR_ZONES];
 	unsigned long max_dma32 = min;
+#if defined(CONFIG_ZONE_DMA) || defined(CONFIG_ZONE_DMA)
 	unsigned long max_dma = min;
+#endif
 
 	memset(zone_size, 0, sizeof(zone_size));
 
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-10-16 15:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-15 22:43 [PATCH -next] arm64: mm: Fix unused variable warning in zone_sizes_init Nathan Chancellor
2019-10-16  3:00 ` Will Deacon
2019-10-16  3:08   ` Nathan Chancellor
2019-10-16  3:11 ` [PATCH -next v2] " Nathan Chancellor
2019-10-16  8:54   ` Nicolas Saenz Julienne
2019-10-16 14:40   ` Catalin Marinas
2019-10-16 14:47   ` [PATCH -next v3] " Nathan Chancellor
2019-10-16 15:08     ` Catalin Marinas
2019-10-16 15:09       ` Nicolas Saenz Julienne
2019-10-16 15:51         ` Nathan Chancellor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).