Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64: mm: remove pointless PAGE_MASKing

As pgd_offset{,_k} shift the input address by PGDIR_SHIFT, the sub-page
bits will always be shifted out. There is no need to apply PAGE_MASK
before this.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Jeremy Linton <jeremy.linton@arm.com>
Cc: Laura Abbott <labbott@fedoraproject.org>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>

authored by

Mark Rutland and committed by
Will Deacon
e2c30ee3 49003a8d

+2 -2
+2 -2
arch/arm64/mm/mmu.c
··· 288 288 &phys, virt); 289 289 return; 290 290 } 291 - __create_mapping(&init_mm, pgd_offset_k(virt & PAGE_MASK), phys, virt, 291 + __create_mapping(&init_mm, pgd_offset_k(virt), phys, virt, 292 292 size, prot, early_alloc); 293 293 } 294 294 ··· 309 309 return; 310 310 } 311 311 312 - return __create_mapping(&init_mm, pgd_offset_k(virt & PAGE_MASK), 312 + return __create_mapping(&init_mm, pgd_offset_k(virt), 313 313 phys, virt, size, prot, late_alloc); 314 314 } 315 315