]> www.infradead.org Git - users/dwmw2/linux.git/commit
memblock: use numa_valid_node() helper to check for invalid node ID
authorMike Rapoport (IBM) <rppt@kernel.org>
Fri, 14 Jun 2024 08:05:43 +0000 (11:05 +0300)
committerMike Rapoport (IBM) <rppt@kernel.org>
Sun, 16 Jun 2024 07:17:57 +0000 (10:17 +0300)
commit8043832e2a123fd9372007a29192f2f3ba328cd6
tree91eead9aeec744a0c76e4da790894a9a35617185
parent3ac36aa7307363b7247ccb6f6a804e11496b2b36
memblock: use numa_valid_node() helper to check for invalid node ID

Introduce numa_valid_node(nid) that verifies that nid is a valid node ID
and use that instead of comparing nid parameter with either NUMA_NO_NODE
or MAX_NUMNODES.

This makes the checks for valid node IDs consistent and more robust and
allows to get rid of multiple WARNings.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
include/linux/numa.h
mm/memblock.c