diff mbox series

[4/4] Fixup for 54f2273e5fef ("module: Move kallsyms support into a separate file")

Message ID c1fdda1d836cdd7a05d3178d5e6ea4b687e548cd.1645525354.git.christophe.leroy@csgroup.eu (mailing list archive)
State Superseded
Headers show
Series [1/4] Fixup for 87b31159f78a ("module: Move all into module/") | expand

Commit Message

Christophe Leroy Feb. 22, 2022, 10:23 a.m. UTC
Fixes: 54f2273e5fef ("module: Move kallsyms support into a separate file")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
 kernel/module/internal.h | 7 ++++---
 kernel/module/kallsyms.c | 3 +--
 2 files changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/kernel/module/internal.h b/kernel/module/internal.h
index 6a54a1e06f4f..fecfa590c149 100644
--- a/kernel/module/internal.h
+++ b/kernel/module/internal.h
@@ -212,12 +212,13 @@  static inline void kmemleak_load_module(const struct module *mod,
 					const struct load_info *info) { }
 #endif /* CONFIG_DEBUG_KMEMLEAK */
 
-#ifdef CONFIG_KALLSYMS
-#ifdef CONFIG_STACKTRACE_BUILD_ID
+#if defined(CONFIG_KALLSYMS) && defined(CONFIG_STACKTRACE_BUILD_ID)
 void init_build_id(struct module *mod, const struct load_info *info);
-#else /* !CONFIG_STACKTRACE_BUILD_ID */
+#else
 static inline void init_build_id(struct module *mod, const struct load_info *info) { }
 #endif
+
+#ifdef CONFIG_KALLSYMS
 void layout_symtab(struct module *mod, struct load_info *info);
 void add_kallsyms(struct module *mod, const struct load_info *info);
 unsigned long find_kallsyms_symbol_value(struct module *mod, const char *name);
diff --git a/kernel/module/kallsyms.c b/kernel/module/kallsyms.c
index 6c8f1f390cf5..2ee8d2e67068 100644
--- a/kernel/module/kallsyms.c
+++ b/kernel/module/kallsyms.c
@@ -171,8 +171,7 @@  void add_kallsyms(struct module *mod, const struct load_info *info)
 	Elf_Shdr *symsec = &info->sechdrs[info->index.sym];
 
 	/* Set up to point into init section. */
-	mod->kallsyms = (struct mod_kallsyms __rcu *)mod->init_layout.base +
-		info->mod_kallsyms_init_off;
+	mod->kallsyms = (void __rcu *)mod->init_layout.base + info->mod_kallsyms_init_off;
 
 	/* The following is safe since this pointer cannot change */
 	rcu_dereference_sched(mod->kallsyms)->symtab = (void *)symsec->sh_addr;