Skip to content

Commit 4b2d631

Browse files
Rtoaxrppt
authored andcommitted
memblock tests: Fix compilation errors.
This patch fix the follow errors. commit 61167ad ("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 dcdfdd4 ("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: dcdfdd4 ("mm: Add support for unaccepted memory") Fixes: 61167ad ("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>
1 parent 0bb80ec commit 4b2d631

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

tools/include/linux/mm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static inline void *phys_to_virt(unsigned long address)
2929
return __va(address);
3030
}
3131

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);
3333

3434
static inline void totalram_pages_inc(void)
3535
{

tools/testing/memblock/internal.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,8 @@ void memblock_free_pages(struct page *page, unsigned long pfn,
2020
{
2121
}
2222

23+
static inline void accept_memory(phys_addr_t start, phys_addr_t end)
24+
{
25+
}
26+
2327
#endif

tools/testing/memblock/mmzone.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ struct pglist_data *next_online_pgdat(struct pglist_data *pgdat)
1111
return NULL;
1212
}
1313

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)
1515
{
1616
}
1717

0 commit comments

Comments
 (0)