Commit 4d9057c3 authored by Aneesh Kumar K.V's avatar Aneesh Kumar K.V Committed by Michael Ellerman

powerpc/mm: Don't hardcode the hash pte slot shift

Use the #define instead of open-coding the same
Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 62607bc6
...@@ -94,7 +94,7 @@ static inline unsigned long __rpte_to_hidx(real_pte_t rpte, unsigned long index) ...@@ -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)) if ((pte_val(rpte.pte) & _PAGE_COMBO))
return (rpte.hidx >> (index<<2)) & 0xf; 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) #define __rpte_to_pte(r) ((r).pte)
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
#define __real_pte(e,p) (e) #define __real_pte(e,p) (e)
#define __rpte_to_pte(r) (__pte(r)) #define __rpte_to_pte(r) (__pte(r))
#endif #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) \ #define pte_iterate_hashed_subpages(rpte, psize, va, index, shift) \
do { \ do { \
......
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
#define __real_pte(e,p) (e) #define __real_pte(e,p) (e)
#define __rpte_to_pte(r) (__pte(r)) #define __rpte_to_pte(r) (__pte(r))
#endif #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) \ #define pte_iterate_hashed_subpages(rpte, psize, va, index, shift) \
do { \ do { \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment