]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
Memory hotplug: Move alternative function definitions to header
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sat, 1 Jun 2013 20:24:07 +0000 (22:24 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sat, 1 Jun 2013 20:24:07 +0000 (22:24 +0200)
Move the definitions of offline_pages() and remove_memory()
for CONFIG_MEMORY_HOTREMOVE to memory_hotplug.h, where they belong,
and make them static inline.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
include/linux/memory_hotplug.h
mm/memory_hotplug.c

index 00569fb4ed6a9d983a869704114931c755ff6d4b..dd38e62b84d2824ecf1e412cdd7fbb908dac675f 100644 (file)
@@ -234,6 +234,8 @@ static inline void unlock_memory_hotplug(void) {}
 
 extern int is_mem_section_removable(unsigned long pfn, unsigned long nr_pages);
 extern void try_offline_node(int nid);
+extern int offline_pages(unsigned long start_pfn, unsigned long nr_pages);
+extern void remove_memory(int nid, u64 start, u64 size);
 
 #else
 static inline int is_mem_section_removable(unsigned long pfn,
@@ -243,6 +245,13 @@ static inline int is_mem_section_removable(unsigned long pfn,
 }
 
 static inline void try_offline_node(int nid) {}
+
+static inline int offline_pages(unsigned long start_pfn, unsigned long nr_pages)
+{
+       return -EINVAL;
+}
+
+static inline void remove_memory(int nid, u64 start, u64 size) {}
 #endif /* CONFIG_MEMORY_HOTREMOVE */
 
 extern int walk_memory_range(unsigned long start_pfn, unsigned long end_pfn,
index 7026fbc42aaa378daba81d704250e328b129e16e..490e3d401e2c87681af1fc33fb4622db1bd6b515 100644 (file)
@@ -1822,11 +1822,5 @@ void __ref remove_memory(int nid, u64 start, u64 size)
 
        unlock_memory_hotplug();
 }
-#else
-int offline_pages(unsigned long start_pfn, unsigned long nr_pages)
-{
-       return -EINVAL;
-}
-void remove_memory(int nid, u64 start, u64 size) {}
-#endif /* CONFIG_MEMORY_HOTREMOVE */
 EXPORT_SYMBOL_GPL(remove_memory);
+#endif /* CONFIG_MEMORY_HOTREMOVE */