UPSTREAM: arm64: mm: remove pointless PAGE_MASKing
authorMark Rutland <mark.rutland@arm.com>
Wed, 9 Dec 2015 12:44:36 +0000 (12:44 +0000)
committerJeff Vander Stoep <jeffv@google.com>
Sun, 18 Sep 2016 20:19:32 +0000 (13:19 -0700)
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>
Bug: 30369029
Patchset: rework-pagetable

(cherry picked from commit e2c30ee320eb96304896c7ab84499e5bc5e5fb6e)
Signed-off-by: Jeff Vander Stoep <jeffv@google.com>
Change-Id: I86d3438aecf7295d5895e1430c1e19fbc82c9719

arch/arm64/mm/mmu.c

index 4c381f0e77a72856c6610f4eb47171596ea25155..7b6e58a58bf3620ee22547b4e6a2104fd172960b 100644 (file)
@@ -288,7 +288,7 @@ static void __init create_mapping(phys_addr_t phys, unsigned long virt,
                        &phys, virt);
                return;
        }
-       __create_mapping(&init_mm, pgd_offset_k(virt & PAGE_MASK), phys, virt,
+       __create_mapping(&init_mm, pgd_offset_k(virt), phys, virt,
                         size, prot, early_alloc);
 }
 
@@ -309,7 +309,7 @@ static void create_mapping_late(phys_addr_t phys, unsigned long virt,
                return;
        }
 
-       return __create_mapping(&init_mm, pgd_offset_k(virt & PAGE_MASK),
+       return __create_mapping(&init_mm, pgd_offset_k(virt),
                                phys, virt, size, prot, late_alloc);
 }