[PATCH 22/22] nodemask: remove the now-unused first_memory_node/next_memory_node

From: Gregory Price (Meta)

Date: Sat Nov 14 2026 - 02:12:50 EST


Both helpers hard-code N_MEMORY, which says only that memory exists.

Every caller now names the state it means, leaving no users of either
helper. Remove them so new code has to pick a node state explicitly
rather than silently getting N_MEMORY.

Signed-off-by: Gregory Price (Meta) <gourry@xxxxxxxxxx>
---
include/linux/nodemask.h | 7 -------
1 file changed, 7 deletions(-)

diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
index 7ace610bdd654..eea0ff7601303 100644
--- a/include/linux/nodemask.h
+++ b/include/linux/nodemask.h
@@ -457,15 +457,10 @@ static __always_inline unsigned int next_node_state(int nid, enum node_states st
}

#define first_online_node first_node_state(N_ONLINE)
-#define first_memory_node first_node_state(N_MEMORY)
static __always_inline unsigned int next_online_node(int nid)
{
return next_node_state(nid, N_ONLINE);
}
-static __always_inline unsigned int next_memory_node(int nid)
-{
- return next_node_state(nid, N_MEMORY);
-}

static __always_inline void node_set_online(int nid)
{
@@ -509,9 +504,7 @@ static __always_inline unsigned int next_node_state(int nid, enum node_states st
}

#define first_online_node 0
-#define first_memory_node 0
#define next_online_node(nid) (MAX_NUMNODES)
-#define next_memory_node(nid) (MAX_NUMNODES)

#define node_set_online(node) node_set_state((node), N_ONLINE)
#define node_set_offline(node) node_clear_state((node), N_ONLINE)
--
2.53.1-Meta