]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
s390/pgtable: add pgste_get helper
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 19 Jul 2013 09:15:54 +0000 (11:15 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 22 Aug 2013 10:20:07 +0000 (12:20 +0200)
ptep_modify_prot_start uses the pgste_set helper to store the pgste,
while ptep_modify_prot_commit uses its own pointer magic to retrieve
the value again. Add the pgste_get help function to keep things
symmetrical and improve readability.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/pgtable.h

index b59b44badae94d209a51c0d062d30656f4a39fcd..26ee897aa1d69e2a4d0d900e5a91218ae85db742 100644 (file)
@@ -619,6 +619,15 @@ static inline void pgste_set_unlock(pte_t *ptep, pgste_t pgste)
 #endif
 }
 
+static inline pgste_t pgste_get(pte_t *ptep)
+{
+       unsigned long pgste = 0;
+#ifdef CONFIG_PGSTE
+       pgste = *(unsigned long *)(ptep + PTRS_PER_PTE);
+#endif
+       return __pgste(pgste);
+}
+
 static inline void pgste_set(pte_t *ptep, pgste_t pgste)
 {
 #ifdef CONFIG_PGSTE
@@ -1098,7 +1107,7 @@ static inline void ptep_modify_prot_commit(struct mm_struct *mm,
        pgste_t pgste;
 
        if (mm_has_pgste(mm)) {
-               pgste = *(pgste_t *)(ptep + PTRS_PER_PTE);
+               pgste = pgste_get(ptep);
                pgste_set_key(ptep, pgste, pte);
                pgste_set_pte(ptep, pte);
                pgste_set_unlock(ptep, pgste);