From: Heiko Carstens Date: Tue, 4 Mar 2025 08:14:31 +0000 (+0100) Subject: s390/mm: Convert pgprot_val() into function X-Git-Tag: v6.15-rc1~113^2~14^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bb2598c0d31bca8e57662b7d203e1876cd7f455f;p=thirdparty%2Fkernel%2Flinux.git s390/mm: Convert pgprot_val() into function 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 Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik --- diff --git a/arch/s390/include/asm/page.h b/arch/s390/include/asm/page.h index 1ff145f7b52b1..5a7d146e34d8e 100644 --- a/arch/s390/include/asm/page.h +++ b/arch/s390/include/asm/page.h @@ -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)