Skip to content

Commit e6eff43

Browse files
jpoimboeJiri Kosina
authored andcommitted
module: Make module_enable_ro() static again
Now that module_enable_ro() has no more external users, make it static again. Suggested-by: Jessica Yu <[email protected]> Signed-off-by: Josh Poimboeuf <[email protected]> Acked-by: Jessica Yu <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 5b384f9 commit e6eff43

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

include/linux/module.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -858,12 +858,6 @@ extern int module_sysfs_initialized;
858858

859859
#define __MODULE_STRING(x) __stringify(x)
860860

861-
#ifdef CONFIG_STRICT_MODULE_RWX
862-
extern void module_enable_ro(const struct module *mod, bool after_init);
863-
#else
864-
static inline void module_enable_ro(const struct module *mod, bool after_init) { }
865-
#endif
866-
867861
#ifdef CONFIG_GENERIC_BUG
868862
void module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *,
869863
struct module *);

kernel/module.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1997,7 +1997,7 @@ static void frob_writable_data(const struct module_layout *layout,
19971997
(layout->size - layout->ro_after_init_size) >> PAGE_SHIFT);
19981998
}
19991999

2000-
void module_enable_ro(const struct module *mod, bool after_init)
2000+
static void module_enable_ro(const struct module *mod, bool after_init)
20012001
{
20022002
if (!rodata_enabled)
20032003
return;
@@ -2025,6 +2025,7 @@ static void module_enable_nx(const struct module *mod)
20252025

20262026
#else /* !CONFIG_STRICT_MODULE_RWX */
20272027
static void module_enable_nx(const struct module *mod) { }
2028+
static void module_enable_ro(const struct module *mod, bool after_init) {}
20282029
#endif /* CONFIG_STRICT_MODULE_RWX */
20292030
static void module_enable_x(const struct module *mod)
20302031
{

0 commit comments

Comments
 (0)