Skip to content

Commit

Permalink
modules: mark ref_module static
Browse files Browse the repository at this point in the history
ref_module isn't used anywhere outside of module.c.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
  • Loading branch information
Christoph Hellwig authored and Jessica Yu committed Aug 1, 2020
1 parent c6a8b84 commit 7ef5264
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion include/linux/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,6 @@ static inline void __module_get(struct module *module)
#define symbol_put_addr(p) do { } while (0)

#endif /* CONFIG_MODULE_UNLOAD */
int ref_module(struct module *a, struct module *b);

/* This is a #define so the string doesn't get put in every .o file */
#define module_name(mod) \
Expand Down
6 changes: 2 additions & 4 deletions kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ static int add_module_usage(struct module *a, struct module *b)
}

/* Module a uses b: caller needs module_mutex() */
int ref_module(struct module *a, struct module *b)
static int ref_module(struct module *a, struct module *b)
{
int err;

Expand All @@ -888,7 +888,6 @@ int ref_module(struct module *a, struct module *b)
}
return 0;
}
EXPORT_SYMBOL_GPL(ref_module);

/* Clear the unload stuff of the module. */
static void module_unload_free(struct module *mod)
Expand Down Expand Up @@ -1169,11 +1168,10 @@ static inline void module_unload_free(struct module *mod)
{
}

int ref_module(struct module *a, struct module *b)
static int ref_module(struct module *a, struct module *b)
{
return strong_try_module_get(b);
}
EXPORT_SYMBOL_GPL(ref_module);

static inline int module_unload_init(struct module *mod)
{
Expand Down

0 comments on commit 7ef5264

Please sign in to comment.