Skip to contentSkip to conversation

mm/page_alloc: add dummy in_mem_hotplug() helper

PATCH New Arnd Bergmann 1 participant 1 message Mar 4, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/page_alloc: add dummy in_mem_hotplug() helper

From: Arnd Bergmann <[email protected]>

The in_mem_hotplug() prototype was only added to the CONFIG_MEMORY_HOTPLUG case but is missing from the alternative:

mm/page_alloc.c: In function 'set_pageblock_migratetype':
/home/arnd/arm-soc/mm/page_alloc.c:424:17: error: implicit declaration of function 'in_mem_hotplug' [-Wimplicit-function-declaration]

  424 |                 in_mem_hotplug() ||
      |                 ^~~~~~~~~~~~~~

Add an empty stub like we have for similar functions.

Fixes b4cfcc26f507 ("mm/page_alloc: add lockdep assertion for pageblock type change")
---
 include/linux/memory_hotplug.h | 4 ++++
 1 file changed, 4 insertions(+)
include/linux/memory_hotplug.h +4 -0
index ff9511d9b9e6..508a1d074527 100644
@@ -224,6 +224,10 @@ static inline void put_online_mems(void) {}
 
 static inline void mem_hotplug_begin(void) {}
 static inline void mem_hotplug_done(void) {}
+static inline bool in_mem_hotplug(void)
+{
+	return false;
+}
 
 static inline bool movable_node_is_enabled(void)
 {
Signature · 1 line
2.39.5