Skip to content
Snippets Groups Projects
Commit b8f8d065 authored by Ansuel Smith's avatar Ansuel Smith Committed by Hauke Mehrtens
Browse files

kernel: fix warning about unused try_to_force_load


There is a longlasting warn about unused defined try_to_force_load.
Fix this by including this function only when actually used.

Signed-off-by: default avatarAnsuel Smith <ansuelsmth@gmail.com>
parent be7e0091
No related branches found
No related tags found
No related merge requests found
...@@ -104,7 +104,23 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> ...@@ -104,7 +104,23 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
config MODULES_TREE_LOOKUP config MODULES_TREE_LOOKUP
--- a/kernel/module.c --- a/kernel/module.c
+++ b/kernel/module.c +++ b/kernel/module.c
@@ -3247,9 +3247,11 @@ static int setup_load_info(struct load_i @@ -1285,6 +1285,7 @@ static struct module_attribute *modinfo_
static const char vermagic[] = VERMAGIC_STRING;
+#if defined(CONFIG_MODVERSIONS) || !defined(CONFIG_MODULE_STRIPPED)
static int try_to_force_load(struct module *mod, const char *reason)
{
#ifdef CONFIG_MODULE_FORCE_LOAD
@@ -1296,6 +1297,7 @@ static int try_to_force_load(struct modu
return -ENOEXEC;
#endif
}
+#endif
#ifdef CONFIG_MODVERSIONS
@@ -3247,9 +3249,11 @@ static int setup_load_info(struct load_i
static int check_modinfo(struct module *mod, struct load_info *info, int flags) static int check_modinfo(struct module *mod, struct load_info *info, int flags)
{ {
...@@ -117,7 +133,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> ...@@ -117,7 +133,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (flags & MODULE_INIT_IGNORE_VERMAGIC) if (flags & MODULE_INIT_IGNORE_VERMAGIC)
modmagic = NULL; modmagic = NULL;
@@ -3270,6 +3272,7 @@ static int check_modinfo(struct module * @@ -3270,6 +3274,7 @@ static int check_modinfo(struct module *
mod->name); mod->name);
add_taint_module(mod, TAINT_OOT_MODULE, LOCKDEP_STILL_OK); add_taint_module(mod, TAINT_OOT_MODULE, LOCKDEP_STILL_OK);
} }
......
...@@ -112,6 +112,22 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> ...@@ -112,6 +112,22 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
config MODULES_TREE_LOOKUP config MODULES_TREE_LOOKUP
--- a/kernel/module.c --- a/kernel/module.c
+++ b/kernel/module.c +++ b/kernel/module.c
@@ -1285,6 +1285,7 @@ static struct module_attribute *modinfo_
static const char vermagic[] = VERMAGIC_STRING;
+#if defined(CONFIG_MODVERSIONS) || !defined(CONFIG_MODULE_STRIPPED)
static int try_to_force_load(struct module *mod, const char *reason)
{
#ifdef CONFIG_MODULE_FORCE_LOAD
@@ -1296,6 +1297,7 @@ static int try_to_force_load(struct modu
return -ENOEXEC;
#endif
}
+#endif
#ifdef CONFIG_MODVERSIONS
@@ -3256,9 +3256,11 @@ static int setup_load_info(struct load_i @@ -3256,9 +3256,11 @@ static int setup_load_info(struct load_i
static int check_modinfo(struct module *mod, struct load_info *info, int flags) static int check_modinfo(struct module *mod, struct load_info *info, int flags)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment