]> www.infradead.org Git - linux.git/commitdiff
memblock tests: fix undefined reference to `early_pfn_to_nid'
authorWei Yang <richard.weiyang@gmail.com>
Tue, 2 Apr 2024 13:26:59 +0000 (13:26 +0000)
committerMike Rapoport (IBM) <rppt@kernel.org>
Thu, 4 Apr 2024 08:08:32 +0000 (11:08 +0300)
commit 6a9531c3a880 ("memblock: fix crash when reserved memory is not
added to memory") introduce the usage of early_pfn_to_nid, which is not
defined in memblock tests.

The original definition of early_pfn_to_nid is defined in mm.h, so let
add this in the corresponding mm.h.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
CC: Yajun Deng <yajun.deng@linux.dev>
CC: Mike Rapoport <rppt@kernel.org>
Link: https://lore.kernel.org/r/20240402132701.29744-2-richard.weiyang@gmail.com
Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
tools/include/linux/mm.h

index f3c82ab5b14cd77819030096b81e0b67cba0df1d..7d73da0980473fd3fdbdcd88e9e041077d5a2df3 100644 (file)
@@ -37,4 +37,9 @@ static inline void totalram_pages_add(long count)
 {
 }
 
+static inline int early_pfn_to_nid(unsigned long pfn)
+{
+       return 0;
+}
+
 #endif