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

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.comSigned-off-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
parent 1eb0a28d
...@@ -2039,7 +2039,7 @@ static void __init free_memmap(unsigned long start_pfn, unsigned long end_pfn) ...@@ -2039,7 +2039,7 @@ static void __init free_memmap(unsigned long start_pfn, unsigned long end_pfn)
* downwards. * downwards.
*/ */
pg = PAGE_ALIGN(__pa(start_pg)); 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 * If there are free pages between these, free the section of the
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#define PHYS_ADDR_MAX (~(phys_addr_t)0) #define PHYS_ADDR_MAX (~(phys_addr_t)0)
#define PAGE_ALIGN(addr) ALIGN(addr, PAGE_SIZE) #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 __va(x) ((void *)((unsigned long)(x)))
#define __pa(x) ((unsigned long)(x)) #define __pa(x) ((unsigned long)(x))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment