summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/book3s/64/hash.h
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2016-04-29 23:25:29 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2016-05-01 18:32:19 +1000
commitee3caed37d763ab28f8ac55563f38fb7530c6252 (patch)
tree61ed790bc3dbbb5ac39c6f95aace931b5712caf3 /arch/powerpc/include/asm/book3s/64/hash.h
parent5dc1ef858c12f865e3676727e03519bece4ce6c1 (diff)
downloadlinux-stable-ee3caed37d763ab28f8ac55563f38fb7530c6252.tar.gz
linux-stable-ee3caed37d763ab28f8ac55563f38fb7530c6252.tar.bz2
linux-stable-ee3caed37d763ab28f8ac55563f38fb7530c6252.zip
powerpc/mm: Use pte_raw() in pte_same()/pmd_same()
We can avoid doing endian conversions by using pte_raw() in pxx_same(). The swap of the constant (_PAGE_HPTEFLAGS) should be done at compile time by the compiler. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/include/asm/book3s/64/hash.h')
-rw-r--r--arch/powerpc/include/asm/book3s/64/hash.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/book3s/64/hash.h b/arch/powerpc/include/asm/book3s/64/hash.h
index 7fc1a9a8169a..22064bd329f2 100644
--- a/arch/powerpc/include/asm/book3s/64/hash.h
+++ b/arch/powerpc/include/asm/book3s/64/hash.h
@@ -372,7 +372,11 @@ static inline int pgd_bad(pgd_t pgd)
}
#define __HAVE_ARCH_PTE_SAME
-#define pte_same(A,B) (((pte_val(A) ^ pte_val(B)) & ~_PAGE_HPTEFLAGS) == 0)
+static inline int pte_same(pte_t pte_a, pte_t pte_b)
+{
+ return (((pte_raw(pte_a) ^ pte_raw(pte_b)) & ~cpu_to_be64(_PAGE_HPTEFLAGS)) == 0);
+}
+
static inline unsigned long pgd_page_vaddr(pgd_t pgd)
{
return (unsigned long)__va(pgd_val(pgd) & ~PGD_MASKED_BITS);