summaryrefslogtreecommitdiff
path: root/tools/include/linux
diff options
context:
space:
mode:
authorWei Yang <richard.weiyang@gmail.com>2024-06-24 04:54:32 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-01-17 15:36:14 +0300
commit85e4923bcbcdb5c16d55833799ddeed571f1bc9a (patch)
tree07e199d6fb06ed4748a207f9ca48d7ea4d4f8477 /tools/include/linux
parentb0b415f1a29d8e502fc9c9b2416859a6b9b7d910 (diff)
downloadlinux-85e4923bcbcdb5c16d55833799ddeed571f1bc9a.tar.xz
memblock tests: fix implicit declaration of function 'numa_valid_node'
commit 9364a7e40d54e6858479f0a96e1a04aa1204be16 upstream. 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. Signed-off-by: Wei Yang <richard.weiyang@gmail.com> CC: Mike Rapoport (IBM) <rppt@kernel.org> Link: https://lore.kernel.org/r/20240624015432.31134-1-richard.weiyang@gmail.com Signed-off-by: Mike Rapoport <rppt@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/include/linux')
-rw-r--r--tools/include/linux/numa.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/include/linux/numa.h b/tools/include/linux/numa.h
index 110b0e5d0fb0..c8b9369335e0 100644
--- a/tools/include/linux/numa.h
+++ b/tools/include/linux/numa.h
@@ -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 */