powerpc/32: refactor pmd_offset(pud_offset(pgd_offset...
authorChristophe Leroy <christophe.leroy@c-s.fr>
Thu, 9 Jan 2020 08:25:25 +0000 (08:25 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 25 Feb 2020 23:34:40 +0000 (10:34 +1100)
commit0b1c524caaae2428b20e714297243e5551251eb5
tree51806fdc1f8b1c14a5fc08b25809bb2062c0eee2
parent05642cf7289c5562e5939d2ee8a0529d310010b8
powerpc/32: refactor pmd_offset(pud_offset(pgd_offset...

At several places pmd pointer is retrieved through the same action:

pmd = pmd_offset(pud_offset(pgd_offset(mm, addr), addr), addr);

or

pmd = pmd_offset(pud_offset(pgd_offset_k(addr), addr), addr);

Refactor this by implementing two helpers pmd_ptr() and pmd_ptr_k()

This will help when adding the p4d level.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/7b065c5be35726af4066cab238ee35cabceda1fa.1578558199.git.christophe.leroy@c-s.fr
arch/powerpc/include/asm/pgtable.h
arch/powerpc/mm/book3s32/mmu.c
arch/powerpc/mm/book3s32/tlb.c
arch/powerpc/mm/kasan/kasan_init_32.c
arch/powerpc/mm/mem.c
arch/powerpc/mm/nohash/40x.c
arch/powerpc/mm/pgtable_32.c