Skip to content

Commit

Permalink
memblock tests: fix undefined reference to `early_pfn_to_nid'
Browse files Browse the repository at this point in the history
commit 6a9531c ("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>
  • Loading branch information
Wei Yang authored and Mike Rapoport (IBM) committed Apr 4, 2024
1 parent 39cd87c commit 7d8ed16
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 7d8ed16

Please sign in to comment.