[PATCH 44/58] mm: Only define is_pageblock_removable_nolock when needed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



mm/page_alloc.c defines is_pageblock_removable_nolock unconditionally,
but include/linux/memory_hotplug.h only prototypes it when
CONFIG_MEMORY_HOTPLUG=y and CONFIG_MEMORY_HOTREMOVE=y.  Add the
corresponding conditions around the definition, too.

This also eliminates warnings from GCC (-Wmissing-prototypes) and Sparse
(-Wdecl).

mm/page_alloc.c:5634:6: warning: no previous prototype for ‘is_pageblock_removable_nolock’ [-Wmissing-prototypes]

Signed-off-by: Josh Triplett <josh@xxxxxxxxxxxxxxxx>
---
 mm/page_alloc.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index d857953..706bd5f 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5631,6 +5631,7 @@ bool has_unmovable_pages(struct zone *zone, struct page *page, int count)
 	return false;
 }
 
+#if defined(CONFIG_MEMORY_HOTPLUG) && defined(CONFIG_MEMORY_HOTREMOVE)
 bool is_pageblock_removable_nolock(struct page *page)
 {
 	struct zone *zone;
@@ -5654,6 +5655,7 @@ bool is_pageblock_removable_nolock(struct page *page)
 
 	return !has_unmovable_pages(zone, page, 0);
 }
+#endif /* defined(CONFIG_MEMORY_HOTPLUG) && defined(CONFIG_MEMORY_HOTREMOVE) */
 
 #ifdef CONFIG_CMA
 
-- 
1.7.10.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]