]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
s390/mm: Convert pgprot_val() into function
authorHeiko Carstens <hca@linux.ibm.com>
Tue, 4 Mar 2025 08:14:31 +0000 (09:14 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 11 Mar 2025 14:27:34 +0000 (15:27 +0100)
Convert pgprot_val() into a function similar to other mm primitives like
e.g. pte_val(). This disallows usage as an lvalue; however there aren't any
such users left, except for some architecture specific ones.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/include/asm/page.h

index 1ff145f7b52b19a23594f362a75b8b5b4276454a..5a7d146e34d8e3ea40894aae839d0dc0a13c481a 100644 (file)
@@ -84,7 +84,11 @@ typedef struct { unsigned long p4d; } p4d_t;
 typedef struct { unsigned long pgd; } pgd_t;
 typedef pte_t *pgtable_t;
 
-#define pgprot_val(x)  ((x).pgprot)
+static inline unsigned long pgprot_val(pgprot_t pgprot)
+{
+       return pgprot.pgprot;
+}
+
 #define pgste_val(x)   ((x).pgste)
 
 static inline unsigned long pte_val(pte_t pte)
@@ -112,13 +116,13 @@ static inline unsigned long pgd_val(pgd_t pgd)
        return pgd.pgd;
 }
 
+#define __pgprot(x)    ((pgprot_t) { (x) } )
 #define __pgste(x)     ((pgste_t) { (x) } )
 #define __pte(x)        ((pte_t) { (x) } )
 #define __pmd(x)        ((pmd_t) { (x) } )
 #define __pud(x)       ((pud_t) { (x) } )
 #define __p4d(x)       ((p4d_t) { (x) } )
 #define __pgd(x)        ((pgd_t) { (x) } )
-#define __pgprot(x)     ((pgprot_t) { (x) } )
 
 static inline void page_set_storage_key(unsigned long addr,
                                        unsigned char skey, int mapped)