]> git.karo-electronics.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, 1 Aug 2013 12:01:14 +0000 (14:01 +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 c2ec8356667992b9fb36d697a7b10bd735ce796e..9ff99931f9aa0268c19e05793fbc914480670484 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
@@ -1102,7 +1111,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);