Skip to content

Commit

Permalink
powerpc: Simplify strict_kernel_rwx_enabled()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christophe Leroy authored and Luis Chamberlain committed Feb 2, 2024
1 parent 315df9c commit 79d9f96
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions arch/powerpc/include/asm/mmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 79d9f96

Please sign in to comment.