]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
memory-hotplug-remove-memmap-of-sparse-vmemmap-fix
authorMichal Hocko <mhocko@suse.cz>
Wed, 20 Feb 2013 02:14:18 +0000 (13:14 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 20 Feb 2013 05:52:32 +0000 (16:52 +1100)
Defconfig for x86_64 complains:
arch/x86/mm/init_64.c: In function `vmemmap_free':
arch/x86/mm/init_64.c:1317: error: implicit declaration of function `remove_pagetable'

vmemmap_free is only used for CONFIG_MEMORY_HOTPLUG so let's move it
inside ifdef

Signed-off-by: Michal Hocko <mhocko@suse.cz>
Tested-by: Lin Feng <linfeng@cn.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/x86/mm/init_64.c
include/linux/mm.h

index bce016deb97605dca7a10ac53ec13464fb77fd05..474e28f108151c67830a6e36476ff44ab4802126 100644 (file)
@@ -1011,6 +1011,14 @@ remove_pagetable(unsigned long start, unsigned long end, bool direct)
        flush_tlb_all();
 }
 
+void __ref vmemmap_free(struct page *memmap, unsigned long nr_pages)
+{
+       unsigned long start = (unsigned long)memmap;
+       unsigned long end = (unsigned long)(memmap + nr_pages);
+
+       remove_pagetable(start, end, false);
+}
+
 static void __meminit
 kernel_physical_mapping_remove(unsigned long start, unsigned long end)
 {
@@ -1348,14 +1356,6 @@ vmemmap_populate(struct page *start_page, unsigned long size, int node)
        return 0;
 }
 
-void __ref vmemmap_free(struct page *memmap, unsigned long nr_pages)
-{
-       unsigned long start = (unsigned long)memmap;
-       unsigned long end = (unsigned long)(memmap + nr_pages);
-
-       remove_pagetable(start, end, false);
-}
-
 #if defined(CONFIG_MEMORY_HOTPLUG_SPARSE) && defined(CONFIG_HAVE_BOOTMEM_INFO_NODE)
 void register_page_bootmem_memmap(unsigned long section_nr,
                                  struct page *start_page, unsigned long size)
index d87cef8d093f2624f70202174fe61801970e863b..5ca9b9a588e1a2ff1cdfeb9836939fb3236de7fc 100644 (file)
@@ -1720,7 +1720,9 @@ int vmemmap_populate_basepages(struct page *start_page,
                                                unsigned long pages, int node);
 int vmemmap_populate(struct page *start_page, unsigned long pages, int node);
 void vmemmap_populate_print_last(void);
+#ifdef CONFIG_MEMORY_HOTPLUG
 void vmemmap_free(struct page *memmap, unsigned long nr_pages);
+#endif
 void register_page_bootmem_memmap(unsigned long section_nr, struct page *map,
                                  unsigned long size);