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

memblock test: fix implicit declaration of function 'virt_to_phys'

Commit 94ff46de4a73 ("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>

authored by

Wei Yang and committed by
Mike Rapoport (Microsoft)
39f64e40 e2ae9cf3

+6
+6
tools/include/linux/mm.h
··· 25 25 return __va(address); 26 26 } 27 27 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 + 28 34 void reserve_bootmem_region(phys_addr_t start, phys_addr_t end, int nid); 29 35 30 36 static inline void totalram_pages_inc(void)