Move klp_find_func() out of the static scope to make it available outside of core.c. It will be reused by the upcoming patch.
Signed-off-by: Yafang Shao <[email protected]> --- include/linux/livepatch.h | 4 ++++ kernel/livepatch/core.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/linux/livepatch.h b/include/linux/livepatch.h index ba9e3988c07c..70854f542c33 100644 --- a/include/linux/livepatch.h +++ b/include/linux/livepatch.h @@ -215,6 +215,10 @@ int klp_apply_section_relocs(struct module *pmod, Elf_Shdr *sechdrs, unsigned int symindex, unsigned int secindex, const char *objname); +struct klp_func *klp_find_func(struct klp_object *obj, + struct klp_func *old_func); + + #else /* !CONFIG_LIVEPATCH */ static inline int klp_module_coming(struct module *mod) { return 0; } diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c index 28d15ba58a26..e97df3e59057 100644 --- a/kernel/livepatch/core.c +++ b/kernel/livepatch/core.c @@ -82,8 +82,8 @@ static bool klp_initialized(void) return !!klp_root_kobj; } -static struct klp_func *klp_find_func(struct klp_object *obj, - struct klp_func *old_func) +struct klp_func *klp_find_func(struct klp_object *obj, + struct klp_func *old_func) { struct klp_func *func; -- 2.47.3
