[PATCH 1/5] memblock test: fix implicit declaration of function 'virt_to_phys'
From: Wei Yang
Date: Wed Jul 24 2024 - 21:42:10 EST
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 kernel.h to fix the build error.
Signed-off-by: Wei Yang <richard.weiyang@xxxxxxxxx>
---
tools/testing/memblock/linux/kernel.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/testing/memblock/linux/kernel.h b/tools/testing/memblock/linux/kernel.h
index d2f148bd8902..ca56f36ef296 100644
--- a/tools/testing/memblock/linux/kernel.h
+++ b/tools/testing/memblock/linux/kernel.h
@@ -9,4 +9,6 @@
#include <linux/linkage.h>
#include <linux/kconfig.h>
+#define virt_to_phys(p) ((unsigned long)p)
+
#endif
--
2.34.1