Skip to content

Commit 39f64e4

Browse files
RichardWeiYangrppt
authored andcommitted
memblock test: fix implicit declaration of function 'virt_to_phys'
Commit 94ff46d ("memblock: Move late alloc warning down to phys alloc") introduce the usage of virt_to_phys(), which is not defined in memblock tests. Define it in mm.h to fix the build error. Signed-off-by: Wei Yang <richard.weiyang@gmail.com> Link: https://lore.kernel.org/r/20240806010319.29194-1-richard.weiyang@gmail.com Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
1 parent e2ae9cf commit 39f64e4

File tree

1 file changed

+6
-0
lines changed
  • tools/include/linux

1 file changed

+6
-0
lines changed

tools/include/linux/mm.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ static inline void *phys_to_virt(unsigned long address)
2525
return __va(address);
2626
}
2727

28+
#define virt_to_phys virt_to_phys
29+
static inline phys_addr_t virt_to_phys(volatile void *address)
30+
{
31+
return (phys_addr_t)address;
32+
}
33+
2834
void reserve_bootmem_region(phys_addr_t start, phys_addr_t end, int nid);
2935

3036
static inline void totalram_pages_inc(void)

0 commit comments

Comments
 (0)