From: Matt Turner Date: Fri, 3 Apr 2026 15:01:28 +0000 (-0400) Subject: alpha: Define pgprot_modify to silence tautological comparison warnings X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bd39fc81340aed5445c731eb391af9ac9a701658;p=thirdparty%2Fkernel%2Flinux.git alpha: Define pgprot_modify to silence tautological comparison warnings Alpha's pgprot_noncached, pgprot_writecombine, and pgprot_device are all identity macros, so the generic pgprot_modify() produces tautological self-comparisons that GCC warns about: include/linux/pgtable.h:1701:25: warning: self-comparison always evaluates to true [-Wtautological-compare] Since all caching attributes are no-ops on Alpha, define pgprot_modify() to simply return newprot. Assisted-by: Claude:claude-opus-4-6 Signed-off-by: Matt Turner Reviewed-by: Magnus Lindholm Link: https://lore.kernel.org/r/20260403150128.488513-1-mattst88@gmail.com Signed-off-by: Magnus Lindholm --- diff --git a/arch/alpha/include/asm/pgtable.h b/arch/alpha/include/asm/pgtable.h index e9368c54be452..58870cad33517 100644 --- a/arch/alpha/include/asm/pgtable.h +++ b/arch/alpha/include/asm/pgtable.h @@ -126,6 +126,17 @@ struct vm_area_struct; */ #define pgprot_noncached(prot) (prot) +/* + * All caching attribute macros are identity on Alpha, so the generic + * pgprot_modify() degenerates to tautological self-comparisons. + * Override it to just return newprot directly. + */ +#define pgprot_modify pgprot_modify +static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot) +{ + return newprot; +} + /* * ZERO_PAGE is a global shared page that is always zero: used * for zero-mapped memory areas etc..