From ec46411eb4efb3366f1614663566a67bf2231c5b Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 30 Jul 2020 08:10:20 +0200 Subject: [PATCH] UPSTREAM: modules: mark ref_module static ref_module isn't used anywhere outside of module.c. Bug: 157965270 Bug: 171277690 Signed-off-by: Christoph Hellwig Signed-off-by: Jessica Yu (cherry picked from commit 7ef5264de773279b9f23b6cc8afb5addb30e970b) Signed-off-by: Greg Kroah-Hartman Change-Id: I68f39675f53b745664c833ac150d838563c78aae Signed-off-by: Greg Kroah-Hartman --- include/linux/module.h | 1 - kernel/module.c | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/include/linux/module.h b/include/linux/module.h index 996e81a51fbf..7b3500539cae 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -648,7 +648,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) \ diff --git a/kernel/module.c b/kernel/module.c index 63c0a2d1db66..9a319c9447f7 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -866,7 +866,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; @@ -885,7 +885,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) @@ -1165,11 +1164,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) {