Skip to contentSkip to conversation

mm: avoid unused variables in memmap_init_zone

PATCH New Arnd Bergmann 1 participant 1 message Jan 1, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: avoid unused variables in memmap_init_zone

A quick fix on mm/page_alloc.c introduced a harmless warning:

mm/page_alloc.c: In function 'memmap_init_zone':
mm/page_alloc.c:4617:44: warning: unused variable 'tmp' [-Wunused-variable] mm/page_alloc.c:4617:26: warning: unused variable 'r' [-Wunused-variable]

This uses another #ifdef to avoid declaring the two variables when the code is not built.

Fixes 4c877dea44c4 ("a")

---
This was obvious for any builds on yesterday's linux-next, so most likely it has already been submitted and/or fixed. If not, please fold this patch into the one that caused the warning.

mm/page_alloc.c +2 -0
index 47457a7a8f1f..cf6437b23bfa 100644
@@ -4614,7 +4614,9 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
 	unsigned long pfn;
 	struct zone *z;
 	unsigned long nr_initialised = 0;
+#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
 	struct memblock_region *r = NULL, *tmp;
+#endif
 
 	if (highest_memmap_pfn < end_pfn - 1)
 		highest_memmap_pfn = end_pfn - 1;

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>