]> Pileus Git - ~andy/linux/commitdiff
page_alloc: make setup_nr_node_ids() usable for arch init code
authorCody P Schafer <cody@linux.vnet.ibm.com>
Mon, 29 Apr 2013 22:08:01 +0000 (15:08 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 29 Apr 2013 22:54:36 +0000 (15:54 -0700)
powerpc and x86 were opencoding copies of setup_nr_node_ids(), which
page_alloc provides but makes static.  Make it avaliable to the archs in
linux/mm.h.

Signed-off-by: Cody P Schafer <cody@linux.vnet.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/mm.h
mm/page_alloc.c

index 6d7266842abd3b8e7e6d923da54ec4a7b703c649..7aa11a6736ebe1ae60a2ded220193251396d374a 100644 (file)
@@ -1816,5 +1816,11 @@ static inline unsigned int debug_guardpage_minorder(void) { return 0; }
 static inline bool page_is_guard(struct page *page) { return false; }
 #endif /* CONFIG_DEBUG_PAGEALLOC */
 
+#if MAX_NUMNODES > 1
+void __init setup_nr_node_ids(void);
+#else
+static inline void setup_nr_node_ids(void) {}
+#endif
+
 #endif /* __KERNEL__ */
 #endif /* _LINUX_MM_H */
index 5a234b64f3ac5451c0ae9a7b926a5c2accee1602..98cbdf6e553217a87b62daac80d26c026ecf60e3 100644 (file)
@@ -4749,7 +4749,7 @@ void __paginginit free_area_init_node(int nid, unsigned long *zones_size,
 /*
  * Figure out the number of possible node ids.
  */
-static void __init setup_nr_node_ids(void)
+void __init setup_nr_node_ids(void)
 {
        unsigned int node;
        unsigned int highest = 0;
@@ -4758,10 +4758,6 @@ static void __init setup_nr_node_ids(void)
                highest = node;
        nr_node_ids = highest + 1;
 }
-#else
-static inline void setup_nr_node_ids(void)
-{
-}
 #endif
 
 /**