Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

memblock tests: Fix compilation errors.

This patch fix the follow errors.

commit 61167ad5fecd ("mm: pass nid to reserve_bootmem_region()") pass nid
parameter to reserve_bootmem_region(),

$ make -C tools/testing/memblock/
...
memblock.c: In function ‘memmap_init_reserved_pages’:
memblock.c:2111:25: error: too many arguments to function ‘reserve_bootmem_region’
2111 | reserve_bootmem_region(start, end, nid);
| ^~~~~~~~~~~~~~~~~~~~~~
../../include/linux/mm.h:32:6: note: declared here
32 | void reserve_bootmem_region(phys_addr_t start, phys_addr_t end);
| ^~~~~~~~~~~~~~~~~~~~~~
memblock.c:2122:17: error: too many arguments to function ‘reserve_bootmem_region’
2122 | reserve_bootmem_region(start, end, nid);
| ^~~~~~~~~~~~~~~~~~~~~~

commit dcdfdd40fa82 ("mm: Add support for unaccepted memory") call
accept_memory() in memblock.c

$ make -C tools/testing/memblock/
...
cc -fsanitize=address -fsanitize=undefined main.o memblock.o \
lib/slab.o mmzone.o slab.o tests/alloc_nid_api.o \
tests/alloc_helpers_api.o tests/alloc_api.o tests/basic_api.o \
tests/common.o tests/alloc_exact_nid_api.o -o main
/usr/bin/ld: memblock.o: in function `memblock_alloc_range_nid':
memblock.c:(.text+0x7ae4): undefined reference to `accept_memory'

Signed-off-by: Rong Tao <rongtao@cestc.cn>
Fixes: dcdfdd40fa82 ("mm: Add support for unaccepted memory")
Fixes: 61167ad5fecd ("mm: pass nid to reserve_bootmem_region()")
Link: https://lore.kernel.org/r/tencent_6F19BC082167F15DF2A8D8BEFE8EF220F60A@qq.com
Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>

authored by

Rong Tao and committed by
Mike Rapoport (IBM)
4b2d6312 0bb80ecc

+6 -2
+1 -1
tools/include/linux/mm.h
··· 29 29 return __va(address); 30 30 } 31 31 32 - void reserve_bootmem_region(phys_addr_t start, phys_addr_t end); 32 + void reserve_bootmem_region(phys_addr_t start, phys_addr_t end, int nid); 33 33 34 34 static inline void totalram_pages_inc(void) 35 35 {
+4
tools/testing/memblock/internal.h
··· 20 20 { 21 21 } 22 22 23 + static inline void accept_memory(phys_addr_t start, phys_addr_t end) 24 + { 25 + } 26 + 23 27 #endif
+1 -1
tools/testing/memblock/mmzone.c
··· 11 11 return NULL; 12 12 } 13 13 14 - void reserve_bootmem_region(phys_addr_t start, phys_addr_t end) 14 + void reserve_bootmem_region(phys_addr_t start, phys_addr_t end, int nid) 15 15 { 16 16 } 17 17