powerpc: Simplify strict_kernel_rwx_enabled()
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Thu, 21 Dec 2023 09:02:48 +0000 (10:02 +0100)
committerLuis Chamberlain <mcgrof@kernel.org>
Fri, 2 Feb 2024 18:21:25 +0000 (10:21 -0800)
Now that rodata_enabled is always declared, remove #ifdef
and define a single version of strict_kernel_rwx_enabled().

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
arch/powerpc/include/asm/mmu.h

index d8b7e246a32f5925bc09132bc56db598920fffb5..24241995f7406e7f30b3b0b2b8537fb3f59e85f1 100644 (file)
@@ -330,17 +330,10 @@ static __always_inline bool early_radix_enabled(void)
        return early_mmu_has_feature(MMU_FTR_TYPE_RADIX);
 }
 
-#ifdef CONFIG_STRICT_KERNEL_RWX
 static inline bool strict_kernel_rwx_enabled(void)
 {
-       return rodata_enabled;
+       return IS_ENABLED(CONFIG_STRICT_KERNEL_RWX) && rodata_enabled;
 }
-#else
-static inline bool strict_kernel_rwx_enabled(void)
-{
-       return false;
-}
-#endif
 
 static inline bool strict_module_rwx_enabled(void)
 {