aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorZhang Yanfei <zhangyanfei@cn.fujitsu.com>2013-07-08 19:00:10 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-09 13:33:22 -0400
commitf3deb6872b946a851a3799b315f3c85ce4c027fc (patch)
treef32542ac1449313de8d8c6bc02cc64a7d9aed187 /mm
parent929aaf56958ab2300919653b923413af695470a5 (diff)
mm/sparse.c: put clear_hwpoisoned_pages within CONFIG_MEMORY_HOTREMOVE
With CONFIG_MEMORY_HOTREMOVE unset, there is a compile warning: mm/sparse.c:755: warning: `clear_hwpoisoned_pages' defined but not used And Bisecting it ended up pointing to 4edd7ceff ("mm, hotplug: avoid compiling memory hotremove functions when disabled"). This is because the commit above put sparse_remove_one_section() within the protection of CONFIG_MEMORY_HOTREMOVE but the only user of clear_hwpoisoned_pages() is sparse_remove_one_section(), and it is not within the protection of CONFIG_MEMORY_HOTREMOVE. So put clear_hwpoisoned_pages within CONFIG_MEMORY_HOTREMOVE should fix the warning. Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com> Cc: David Rientjes <rientjes@google.com> Acked-by: Toshi Kani <toshi.kani@hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/sparse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/sparse.c b/mm/sparse.c
index b38400f0fb8d..308d50331bc3 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -753,6 +753,7 @@ out:
753 return ret; 753 return ret;
754} 754}
755 755
756#ifdef CONFIG_MEMORY_HOTREMOVE
756#ifdef CONFIG_MEMORY_FAILURE 757#ifdef CONFIG_MEMORY_FAILURE
757static void clear_hwpoisoned_pages(struct page *memmap, int nr_pages) 758static void clear_hwpoisoned_pages(struct page *memmap, int nr_pages)
758{ 759{
@@ -774,7 +775,6 @@ static inline void clear_hwpoisoned_pages(struct page *memmap, int nr_pages)
774} 775}
775#endif 776#endif
776 777
777#ifdef CONFIG_MEMORY_HOTREMOVE
778static void free_section_usemap(struct page *memmap, unsigned long *usemap) 778static void free_section_usemap(struct page *memmap, unsigned long *usemap)
779{ 779{
780 struct page *usemap_page; 780 struct page *usemap_page;