Skip to contentSkip to conversation

m68k: mm: Use PAGE_ALIGNED() helper

PATCH In review Geert Uytterhoeven 1 participant 2 messages Aug 26, 2020 – Sep 7, 2020 m68k architecture

lore
Share & tools
lore

Geert Uytterhoeven

author maintainer
#0 lore raw

PATCH 1/1 m68k: mm: Use PAGE_ALIGNED() helper

Use the existing PAGE_ALIGNED() helper instead of open-coding the same operation.

---
 arch/m68k/mm/motorola.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/m68k/mm/motorola.c +2 -2
index 2bb006bdc31cd644..a9bdde54ca350197 100644
@@ -226,7 +226,7 @@ static pte_t * __init kernel_page_table(void)
 {
 	pte_t *pte_table = last_pte_table;
 
-	if (((unsigned long)last_pte_table & ~PAGE_MASK) == 0) {
+	if (PAGE_ALIGNED(last_pte_table)) {
 		pte_table = (pte_t *)memblock_alloc_low(PAGE_SIZE, PAGE_SIZE);
 		if (!pte_table) {
 			panic("%s: Failed to allocate %lu bytes align=%lx\n",
@@ -274,7 +274,7 @@ static pmd_t * __init kernel_ptr_table(void)
 	}
 
 	last_pmd_table += PTRS_PER_PMD;
-	if (((unsigned long)last_pmd_table & ~PAGE_MASK) == 0) {
+	if (PAGE_ALIGNED(last_pmd_table)) {
 		last_pmd_table = (pmd_t *)memblock_alloc_low(PAGE_SIZE,
 							   PAGE_SIZE);
 		if (!last_pmd_table)
Signature · 1 line
2.17.1
author maintainer
#1 lore raw
Quoted 4 lines · Geert Uytterhoeven

Use the existing PAGE_ALIGNED() helper instead of open-coding the same operation.

Thanks, queueing in the m68k for-v5.10 branch.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds