powerpc/mm: Don't hardcode the hash pte slot shift
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Tue, 1 Dec 2015 03:36:56 +0000 (09:06 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 14 Dec 2015 04:19:15 +0000 (15:19 +1100)
Use the #define instead of open-coding the same

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/book3s/64/hash-64k.h
arch/powerpc/include/asm/book3s/64/pgtable.h
arch/powerpc/include/asm/nohash/64/pgtable.h

index cca050aa1aa8643984bb117bbc840e0eb4209ff0..9f9942998587c0935dabb216c1d6e83193594ac5 100644 (file)
@@ -94,7 +94,7 @@ static inline unsigned long __rpte_to_hidx(real_pte_t rpte, unsigned long index)
 {
        if ((pte_val(rpte.pte) & _PAGE_COMBO))
                return (rpte.hidx >> (index<<2)) & 0xf;
-       return (pte_val(rpte.pte) >> 12) & 0xf;
+       return (pte_val(rpte.pte) >> _PAGE_F_GIX_SHIFT) & 0xf;
 }
 
 #define __rpte_to_pte(r)       ((r).pte)
index bb97b6a52b846ef5fcda82bbef1ad57659cbd904..a2d4e0e370676b065ea73744abcd76f7e2c02538 100644 (file)
@@ -50,7 +50,7 @@
 #define __real_pte(e,p)                (e)
 #define __rpte_to_pte(r)       (__pte(r))
 #endif
-#define __rpte_to_hidx(r,index)        (pte_val(__rpte_to_pte(r)) >> 12)
+#define __rpte_to_hidx(r,index)        (pte_val(__rpte_to_pte(r)) >>_PAGE_F_GIX_SHIFT)
 
 #define pte_iterate_hashed_subpages(rpte, psize, va, index, shift)       \
        do {                                                             \
index d635a924d652bc24fd72b9301cf9bd86d311f5cd..03c226965b4664cd5fa46f4dc36a3913c8dd900c 100644 (file)
 #define __real_pte(e,p)                (e)
 #define __rpte_to_pte(r)       (__pte(r))
 #endif
-#define __rpte_to_hidx(r,index)        (pte_val(__rpte_to_pte(r)) >> 12)
+#define __rpte_to_hidx(r,index)        (pte_val(__rpte_to_pte(r)) >> _PAGE_F_GIX_SHIFT)
 
 #define pte_iterate_hashed_subpages(rpte, psize, va, index, shift)       \
        do {                                                             \