Skip to content

Commit

Permalink
module: Make module_enable_ro() static again
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
jpoimboe authored and Jiri Kosina committed May 7, 2020
1 parent 5b384f9 commit e6eff43
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
6 changes: 0 additions & 6 deletions include/linux/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -858,12 +858,6 @@ extern int module_sysfs_initialized;

#define __MODULE_STRING(x) __stringify(x)

#ifdef CONFIG_STRICT_MODULE_RWX
extern void module_enable_ro(const struct module *mod, bool after_init);
#else
static inline void module_enable_ro(const struct module *mod, bool after_init) { }
#endif

#ifdef CONFIG_GENERIC_BUG
void module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *,
struct module *);
Expand Down
3 changes: 2 additions & 1 deletion kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1997,7 +1997,7 @@ static void frob_writable_data(const struct module_layout *layout,
(layout->size - layout->ro_after_init_size) >> PAGE_SHIFT);
}

void module_enable_ro(const struct module *mod, bool after_init)
static void module_enable_ro(const struct module *mod, bool after_init)
{
if (!rodata_enabled)
return;
Expand Down Expand Up @@ -2025,6 +2025,7 @@ static void module_enable_nx(const struct module *mod)

#else /* !CONFIG_STRICT_MODULE_RWX */
static void module_enable_nx(const struct module *mod) { }
static void module_enable_ro(const struct module *mod, bool after_init) {}
#endif /* CONFIG_STRICT_MODULE_RWX */
static void module_enable_x(const struct module *mod)
{
Expand Down

0 comments on commit e6eff43

Please sign in to comment.