From 315df9c476c587af26467f10c6f27414572f3938 Mon Sep 17 00:00:00 2001 From: Christophe Leroy Date: Thu, 21 Dec 2023 10:02:47 +0100 Subject: [PATCH] modules: Remove #ifdef CONFIG_STRICT_MODULE_RWX around rodata_enabled Now that rodata_enabled is declared at all time, the #ifdef CONFIG_STRICT_MODULE_RWX can be removed. Signed-off-by: Christophe Leroy Signed-off-by: Luis Chamberlain --- kernel/module/strict_rwx.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/kernel/module/strict_rwx.c b/kernel/module/strict_rwx.c index 9b2d58a8d59d..b36d93983465 100644 --- a/kernel/module/strict_rwx.c +++ b/kernel/module/strict_rwx.c @@ -38,12 +38,8 @@ void module_enable_text_rox(const struct module *mod) void module_enable_rodata_ro(const struct module *mod, bool after_init) { - if (!IS_ENABLED(CONFIG_STRICT_MODULE_RWX)) + if (!IS_ENABLED(CONFIG_STRICT_MODULE_RWX) || !rodata_enabled) return; -#ifdef CONFIG_STRICT_MODULE_RWX - if (!rodata_enabled) - return; -#endif module_set_memory(mod, MOD_RODATA, set_memory_ro); module_set_memory(mod, MOD_INIT_RODATA, set_memory_ro);