[PATCH] mm/sparse.c: fix the building warning with !SPARSEMEM

From: Baoquan He
Date: Fri Mar 13 2020 - 08:25:54 EST


Stephen reported below warnings are seen with allnoconfig on x86_64.
Fix it by making those dummy functions sub-section map handling visible
with CONFIG_SPARSEMEM enabled.

mm/sparse.c:311:12: warning: 'fill_subsection_map' defined but not used [-Wunused-function]
311 | static int fill_subsection_map(unsigned long pfn, unsigned long nr_pages)
| ^~~~~~~~~~~~~~~~~~~
mm/sparse.c:306:13: warning: 'is_subsection_map_empty' defined but not used [-Wunused-function]
306 | static bool is_subsection_map_empty(struct mem_section *ms)
| ^~~~~~~~~~~~~~~~~~~~~~~
mm/sparse.c:301:12: warning: 'clear_subsection_map' defined but not used [-Wunused-function]
301 | static int clear_subsection_map(unsigned long pfn, unsigned long nr_pages)
| ^~~~~~~~~~~~~~~~~~~~

Signed-off-by: Baoquan He <bhe@xxxxxxxxxx>
---
mm/sparse.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/sparse.c b/mm/sparse.c
index 362018e82e22..9e08d118719f 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -293,7 +293,7 @@ static int fill_subsection_map(unsigned long pfn, unsigned long nr_pages)

return rc;
}
-#else
+#elif defined(CONFIG_SPARSEMEM)
void __init subsection_map_init(unsigned long pfn, unsigned long nr_pages)
{
}
--
2.17.2