[PATCH] powerpc/mm: Use pte_advance_pfn() in set_huge_pte_at()

Andrew Donnellan
2025-12-18T16:22:11Z

In set_huge_pte_at(), replace the existing open coded pte value
calculation with the new helper pte_advance_pfn().

Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
---
arch/powerpc/mm/pgtable.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/mm/pgtable.c b/arch/powerpc/mm/pgtable.c
index 56d7e8960e77d877390d6bcbf0d8a305cc222101..9073e373e1e8a88f904cae592e1e8c34707545e6 100644
--- a/arch/powerpc/mm/pgtable.c
+++ b/arch/powerpc/mm/pgtable.c
@@ -365,7 +365,7 @@ void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep,

for (i = 0; i < sz / pdsize; i++, ptep++, addr += pdsize) {
__set_pte_at(mm, addr, ptep, pte, 0);
- pte = __pte(pte_val(pte) + ((unsigned long long)pdsize / PAGE_SIZE << PFN_PTE_SHIFT));
+ pte = pte_advance_pfn(pte, pdsize / PAGE_SIZE);
}
}
#endif

---
base-commit: ea1013c1539270e372fc99854bc6e4d94eaeff66
change-id: 20251219-set_huge_pte_at_pte_advance_pfn-0ae18078fcca

--
Andrew Donnellan OzLabs, ADL Canberra
ajd@linux.ibm.com IBM Australia Limited