mm: make memmap_init a proper function
authorPavel Tatashin <[email protected]>
Fri, 26 Oct 2018 22:09:32 +0000 (15:09 -0700)
committerLinus Torvalds <[email protected]>
Fri, 26 Oct 2018 23:26:35 +0000 (16:26 -0700)
memmap_init is sometimes a macro sometimes a function based on
__HAVE_ARCH_MEMMAP_INIT.  It is only a function on ia64.  Make memmap_init
a weak function instead, and let ia64 redefine it.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Pavel Tatashin <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Reviewed-by: Oscar Salvador <[email protected]>
Cc: Steven Sistare <[email protected]>
Cc: Daniel Jordan <[email protected]>
Cc: Kirill A. Shutemov <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Dan Williams <[email protected]>
Cc: Jan Kara <[email protected]>
Cc: Jérôme Glisse <[email protected]>
Cc: Souptick Joarder <[email protected]>
Cc: Baoquan He <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Cc: Wei Yang <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Pavel Tatashin <[email protected]>
Cc: Abdul Haleem <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: Pasha Tatashin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
arch/ia64/include/asm/pgtable.h
mm/page_alloc.c

index 165827774bea75e7d20953d63e030059d010cf49..b1e7468eb65a14008954b59afae083320e48ae9c 100644 (file)
@@ -544,7 +544,6 @@ extern struct page *zero_page_memmap_ptr;
 
 #  ifdef CONFIG_VIRTUAL_MEM_MAP
   /* arch mem_map init routine is needed due to holes in a virtual mem_map */
-#   define __HAVE_ARCH_MEMMAP_INIT
     extern void memmap_init (unsigned long size, int nid, unsigned long zone,
                             unsigned long start_pfn);
 #  endif /* CONFIG_VIRTUAL_MEM_MAP */
index bdb7eb25acf8f05f66643e6869135071122edb07..94725aea672f272dbc414e4bf1e72bcc4c17c012 100644 (file)
@@ -5631,10 +5631,11 @@ static void __meminit zone_init_free_lists(struct zone *zone)
        }
 }
 
-#ifndef __HAVE_ARCH_MEMMAP_INIT
-#define memmap_init(size, nid, zone, start_pfn) \
-       memmap_init_zone((size), (nid), (zone), (start_pfn), MEMMAP_EARLY, NULL)
-#endif
+void __meminit __weak memmap_init(unsigned long size, int nid,
+                                 unsigned long zone, unsigned long start_pfn)
+{
+       memmap_init_zone(size, nid, zone, start_pfn, MEMMAP_EARLY, NULL);
+}
 
 static int zone_batchsize(struct zone *zone)
 {