Commit b73f6b98 authored by Wei Yang's avatar Wei Yang Committed by Mike Rapoport (IBM)
Browse files

mm/memblock: use PAGE_ALIGN_DOWN to get pgend in free_memmap



Leverage the macro PAGE_ALIGN_DOWN to get pgend.

Signed-off-by: default avatarWei Yang <richard.weiyang@gmail.com>
Link: https://lore.kernel.org/r/20240507075833.6346-7-richard.weiyang@gmail.com


Signed-off-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
parent 1eb0a28d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2039,7 +2039,7 @@ static void __init free_memmap(unsigned long start_pfn, unsigned long end_pfn)
	 * downwards.
	 */
	pg = PAGE_ALIGN(__pa(start_pg));
	pgend = __pa(end_pg) & PAGE_MASK;
	pgend = PAGE_ALIGN_DOWN(__pa(end_pg));

	/*
	 * If there are free pages between these, free the section of the
+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@
#define PHYS_ADDR_MAX	(~(phys_addr_t)0)

#define PAGE_ALIGN(addr) ALIGN(addr, PAGE_SIZE)
#define PAGE_ALIGN_DOWN(addr) ALIGN_DOWN(addr, PAGE_SIZE)

#define __va(x) ((void *)((unsigned long)(x)))
#define __pa(x) ((unsigned long)(x))