Skip to contentSkip to conversation

memblock tests: fix implicit declaration of function 'numa_valid_node'

PATCH Applied Wei Yang 2 participants 3 messages Jun 24, 2024 – Jul 5, 2024 Memory management

lore
Share & tools
lore

Wei Yang

author
#0 lore raw

PATCH 1/1 memblock tests: fix implicit declaration of function 'numa_valid_node'

commit 8043832e2a12 ("memblock: use numa_valid_node() helper to check for invalid node ID") introduce a new helper numa_valid_node(), which is not defined in memblock tests.

Let's add it in the corresponding header file.

CC Mike Rapoport (IBM) <[email protected]>
---
 tools/include/linux/numa.h | 5 +++++
 1 file changed, 5 insertions(+)
tools/include/linux/numa.h +5 -0
index 110b0e5d0fb0..c8b9369335e0 100644
@@ -13,4 +13,9 @@
 
 #define	NUMA_NO_NODE	(-1)
 
+static inline bool numa_valid_node(int nid)
+{
+	return nid >= 0 && nid < MAX_NUMNODES;
+}
+
 #endif /* _LINUX_NUMA_H */
Signature · 1 line
2.34.1
author
#1 lore raw

Mike,

Missed this one?

Quoted 28 lines · Wei Yang

commit 8043832e2a12 ("memblock: use numa_valid_node() helper to check for invalid node ID") introduce a new helper numa_valid_node(), which is not defined in memblock tests.

Let's add it in the corresponding header file.

CC Mike Rapoport (IBM) <[email protected]>

---
tools/include/linux/numa.h | 5 +++++

1 file changed, 5 insertions(+)
tools/include/linux/numa.h +5 -0
index 110b0e5d0fb0..c8b9369335e0 100644
@@ -13,4 +13,9 @@
 
 #define	NUMA_NO_NODE	(-1)
 
+static inline bool numa_valid_node(int nid)
+{
+	return nid >= 0 && nid < MAX_NUMNODES;
+}
+
 #endif /* _LINUX_NUMA_H */
Signature · 1 line
2.34.1
Signature · 2 lines
Wei Yang
Help you, Help me
#2 lore raw
In reply to Wei Yang
Quoted 8 lines · Wei Yang

commit 8043832e2a12 ("memblock: use numa_valid_node() helper to check for invalid node ID") introduce a new helper numa_valid_node(), which is not defined in memblock tests.

Let's add it in the corresponding header file.

[...]

Applied to for-next branch of memblock.git tree, thanks!

[1/1] memblock tests: fix implicit declaration of function 'numa_valid_node'

      commit: 9364a7e40d54e6858479f0a96e1a04aa1204be16

tree: https://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock
branch: for-next

--
Sincerely yours,
Mike.