Skip to contentSkip to conversation

kallsyms: make arch_get_kallsym() static

PATCH In review Ben Dooks 3 participants 3 messages Jul 21, 2022 – Jul 22, 2022

lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

PATCH 1/1 kallsyms: make arch_get_kallsym() static

The arch_get_kallsym() function is not used anywhere in the kernel now, so it should at-least be static or just be removed as there are no users. Making it static fixes the following sparse warning:

kernel/kallsyms.c:590:12: warning: symbol 'arch_get_kallsym' was not declared. Should it be static?

---
 kernel/kallsyms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/kallsyms.c +1 -1
index fbdf8d3279ac..14922fb21f7b 100644
@@ -587,7 +587,7 @@ struct kallsym_iter {
 	int show_value;
 };
 
-int __weak arch_get_kallsym(unsigned int symnum, unsigned long *value,
+static int arch_get_kallsym(unsigned int symnum, unsigned long *value,
 			    char *type, char *name)
 {
 	return -EINVAL;
Signature · 1 line
2.35.1
#1 lore raw
Quoted 5 lines · Ben Dooks

The arch_get_kallsym() function is not used anywhere in the kernel now, so it should at-least be static or just be removed as there are no users. Making it static fixes the following sparse warning:

kernel/kallsyms.c:590:12: warning: symbol 'arch_get_kallsym' was not declared. Should it be static?

It fixes the warning, but isn't exactly useful. Please just remove it, get_ksymbol_arch and iter->pos_arch_end entirely instead.

#2 lore raw
Quoted 9 lines · Christoph Hellwig
Quoted 5 lines · Ben Dooks

The arch_get_kallsym() function is not used anywhere in the kernel now, so it should at-least be static or just be removed as there are no users. Making it static fixes the following sparse warning:

kernel/kallsyms.c:590:12: warning: symbol 'arch_get_kallsym' was not declared. Should it be static?

It fixes the warning, but isn't exactly useful. Please just remove it, get_ksymbol_arch and iter->pos_arch_end entirely instead.

Ok, probably the best. I didn't have time to do any archeaology on it to find out if it has ever been used.

Signature · 3 lines
Ben Dooks, [email protected], http://www.fluff.org/ben/

Large Hadron Colada: A large Pina Colada that makes the universe disappear.