diff mbox series

[v4,1/5] memblock test: fix implicit declaration of function 'virt_to_phys'

Message ID 20240806010319.29194-1-richard.weiyang@gmail.com (mailing list archive)
State New
Headers show
Series [v4,1/5] memblock test: fix implicit declaration of function 'virt_to_phys' | expand

Commit Message

Wei Yang Aug. 6, 2024, 1:03 a.m. UTC
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>

---
v4: fix return type
v3: use static inline as phys_to_virt
v2: move definition to mm.h
---
 tools/include/linux/mm.h | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Mike Rapoport Aug. 6, 2024, 5:29 a.m. UTC | #1
From: Mike Rapoport (Microsoft) <rppt@kernel.org>

On Tue, 06 Aug 2024 01:03:15 +0000, Wei Yang wrote:
> 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.
> 
> 
> [...]

Applied to for-next branch of memblock.git tree, thanks!

[1/5] memblock test: fix implicit declaration of function 'virt_to_phys'
      commit: 39f64e402f659890a99d415eaf63a01f3b80a9a8
[2/5] memblock test: add the definition of __setup()
      commit: 9f76c2ade323121f9006f6a529e0795317e16b5c
[3/5] memblock test: fix implicit declaration of function 'memparse'
      commit: a88cde5769d523e4ae6aad61237e4a5f6bd2309a
[4/5] memblock test: fix implicit declaration of function 'isspace'
      commit: 8ac13bc7c266102f1068faafa5314522b68ebe65
[5/5] memblock test: fix implicit declaration of function 'strscpy'
      commit: 9e3d665384fca2a1c56283c7a79a968243ef4614

tree: https://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock
branch: for-next

--
Sincerely yours,
Mike.
diff mbox series

Patch

diff --git a/tools/include/linux/mm.h b/tools/include/linux/mm.h
index cad4f2927983..677c37e4a18c 100644
--- a/tools/include/linux/mm.h
+++ b/tools/include/linux/mm.h
@@ -25,6 +25,12 @@  static inline void *phys_to_virt(unsigned long address)
 	return __va(address);
 }
 
+#define virt_to_phys virt_to_phys
+static inline phys_addr_t virt_to_phys(volatile void *address)
+{
+	return (phys_addr_t)address;
+}
+
 void reserve_bootmem_region(phys_addr_t start, phys_addr_t end, int nid);
 
 static inline void totalram_pages_inc(void)