From b73f6b98bbd0b4c1fdcebc0c5b926349455035bf Mon Sep 17 00:00:00 2001 From: Wei Yang Date: Tue, 7 May 2024 07:58:32 +0000 Subject: mm/memblock: use PAGE_ALIGN_DOWN to get pgend in free_memmap Leverage the macro PAGE_ALIGN_DOWN to get pgend. Signed-off-by: Wei Yang Link: https://lore.kernel.org/r/20240507075833.6346-7-richard.weiyang@gmail.com Signed-off-by: Mike Rapoport (IBM) --- tools/include/linux/mm.h | 1 + 1 file changed, 1 insertion(+) (limited to 'tools/include/linux') diff --git a/tools/include/linux/mm.h b/tools/include/linux/mm.h index dc0fc7125bc3..cad4f2927983 100644 --- a/tools/include/linux/mm.h +++ b/tools/include/linux/mm.h @@ -12,6 +12,7 @@ #define PHYS_ADDR_MAX (~(phys_addr_t)0) #define PAGE_ALIGN(addr) ALIGN(addr, PAGE_SIZE) +#define PAGE_ALIGN_DOWN(addr) ALIGN_DOWN(addr, PAGE_SIZE) #define __va(x) ((void *)((unsigned long)(x))) #define __pa(x) ((unsigned long)(x)) -- cgit v1.2.3 From 9364a7e40d54e6858479f0a96e1a04aa1204be16 Mon Sep 17 00:00:00 2001 From: Wei Yang Date: Mon, 24 Jun 2024 01:54:32 +0000 Subject: 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. Signed-off-by: Wei Yang CC: Mike Rapoport (IBM) Link: https://lore.kernel.org/r/20240624015432.31134-1-richard.weiyang@gmail.com Signed-off-by: Mike Rapoport --- tools/include/linux/numa.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tools/include/linux') 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 */ -- cgit v1.2.3