diff options
author | Christoph Hellwig <hch@lst.de> | 2021-02-02 13:13:27 +0100 |
---|---|---|
committer | Jessica Yu <jeyu@kernel.org> | 2021-02-08 12:24:04 +0100 |
commit | 3e3552056ab42f883d7723eeb42fed712b66bacf (patch) | |
tree | d910ef68e6a09d0d41b6778a5a2014388981d3ff /kernel/kallsyms.c | |
parent | 013c1667cf78c1d847152f7116436d82dcab3db4 (diff) |
kallsyms: only build {,module_}kallsyms_on_each_symbol when required
kallsyms_on_each_symbol and module_kallsyms_on_each_symbol are only used
by the livepatching code, so don't build them if livepatching is not
enabled.
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
Diffstat (limited to 'kernel/kallsyms.c')
-rw-r--r-- | kernel/kallsyms.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c index a0d3f0865916..8043a90aa50e 100644 --- a/kernel/kallsyms.c +++ b/kernel/kallsyms.c @@ -177,6 +177,7 @@ unsigned long kallsyms_lookup_name(const char *name) return module_kallsyms_lookup_name(name); } +#ifdef CONFIG_LIVEPATCH /* * Iterate over all symbols in vmlinux. For symbols from modules use * module_kallsyms_on_each_symbol instead. @@ -198,6 +199,7 @@ int kallsyms_on_each_symbol(int (*fn)(void *, const char *, struct module *, } return 0; } +#endif /* CONFIG_LIVEPATCH */ static unsigned long get_symbol_pos(unsigned long addr, unsigned long *symbolsize, |