tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: c8dbb3a6e214ad66d5d6099bf76e1f1c6eefc06f commit: a224a248cd1c2627ea20b02c1a8f33edc217881c [2544/2544] livepatch/x86: Move 'struct klp_func_list' related codes out of arch config: x86_64-randconfig-123-20241205 (https://download.01.org/0day-ci/archive/20241208/202412080435.e0zBQYor-lkp@i...) compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241208/202412080435.e0zBQYor-lkp@i...)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot lkp@intel.com | Closes: https://lore.kernel.org/oe-kbuild-all/202412080435.e0zBQYor-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from arch/x86/kernel/livepatch.c:21: In file included from include/linux/kallsyms.h:12: In file included from include/linux/mm.h:1581: include/linux/vmstat.h:431:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion] 431 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_" | ~~~~~~~~~~~ ^ ~~~ arch/x86/kernel/livepatch.c:137:12: error: implicit declaration of function 'add_func_to_list' [-Werror,-Wimplicit-function-declaration] 137 | ret = add_func_to_list(check_funcs, &pcheck, old_func, | ^ arch/x86/kernel/livepatch.c:137:29: error: use of undeclared identifier 'check_funcs' 137 | ret = add_func_to_list(check_funcs, &pcheck, old_func, | ^ arch/x86/kernel/livepatch.c:75:5: warning: no previous prototype for function 'arch_klp_check_activeness_func' [-Wmissing-prototypes] 75 | int arch_klp_check_activeness_func(struct klp_patch *patch, int enable, | ^ arch/x86/kernel/livepatch.c:75:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 75 | int arch_klp_check_activeness_func(struct klp_patch *patch, int enable, | ^ | static
arch/x86/kernel/livepatch.c:315:5: warning: no previous prototype for function 'arch_klp_check_calltrace' [-Wmissing-prototypes]
315 | int arch_klp_check_calltrace(bool (*check_func)(void *, int *, unsigned long), void *data) | ^ arch/x86/kernel/livepatch.c:315:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 315 | int arch_klp_check_calltrace(bool (*check_func)(void *, int *, unsigned long), void *data) | ^ | static arch/x86/kernel/livepatch.c:400:6: warning: no previous prototype for function 'arch_klp_code_modify_prepare' [-Wmissing-prototypes] 400 | void arch_klp_code_modify_prepare(void) | ^ arch/x86/kernel/livepatch.c:400:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 400 | void arch_klp_code_modify_prepare(void) | ^ | static arch/x86/kernel/livepatch.c:406:6: warning: no previous prototype for function 'arch_klp_code_modify_post_process' [-Wmissing-prototypes] 406 | void arch_klp_code_modify_post_process(void) | ^ arch/x86/kernel/livepatch.c:406:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 406 | void arch_klp_code_modify_post_process(void) | ^ | static 5 warnings and 2 errors generated. -- In file included from kernel/livepatch/core.c:16: In file included from include/linux/kallsyms.h:12: In file included from include/linux/mm.h:1581: include/linux/vmstat.h:431:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion] 431 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_" | ~~~~~~~~~~~ ^ ~~~ kernel/livepatch/core.c:71:16: warning: no previous prototype for function 'klp_check_patch_kprobed' [-Wmissing-prototypes] 71 | struct kprobe *klp_check_patch_kprobed(struct klp_patch *patch) | ^ kernel/livepatch/core.c:71:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 71 | struct kprobe *klp_check_patch_kprobed(struct klp_patch *patch) | ^ | static kernel/livepatch/core.c:942:12: warning: no previous prototype for function 'arch_klp_init_func' [-Wmissing-prototypes] 942 | int __weak arch_klp_init_func(struct klp_object *obj, struct klp_func *func) | ^ kernel/livepatch/core.c:942:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 942 | int __weak arch_klp_init_func(struct klp_object *obj, struct klp_func *func) | ^ | static
kernel/livepatch/core.c:1342:12: warning: no previous prototype for function 'arch_klp_check_calltrace' [-Wmissing-prototypes]
1342 | int __weak arch_klp_check_calltrace(bool (*fn)(void *, int *, unsigned long), void *data) | ^ kernel/livepatch/core.c:1342:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 1342 | int __weak arch_klp_check_calltrace(bool (*fn)(void *, int *, unsigned long), void *data) | ^ | static
kernel/livepatch/core.c:1347:12: warning: no previous prototype for function 'arch_klp_check_activeness_func' [-Wmissing-prototypes]
1347 | int __weak arch_klp_check_activeness_func(struct klp_patch *patch, int enable, | ^ kernel/livepatch/core.c:1347:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 1347 | int __weak arch_klp_check_activeness_func(struct klp_patch *patch, int enable, | ^ | static kernel/livepatch/core.c:1412:12: warning: no previous prototype for function 'klp_check_calltrace' [-Wmissing-prototypes] 1412 | int __weak klp_check_calltrace(struct klp_patch *patch, int enable) | ^ kernel/livepatch/core.c:1412:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 1412 | int __weak klp_check_calltrace(struct klp_patch *patch, int enable) | ^ | static kernel/livepatch/core.c:1506:5: warning: no previous prototype for function 'klp_try_disable_patch' [-Wmissing-prototypes] 1506 | int klp_try_disable_patch(void *data) | ^ kernel/livepatch/core.c:1506:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 1506 | int klp_try_disable_patch(void *data) | ^ | static kernel/livepatch/core.c:1540:13: warning: no previous prototype for function 'arch_klp_code_modify_prepare' [-Wmissing-prototypes] 1540 | void __weak arch_klp_code_modify_prepare(void) | ^ kernel/livepatch/core.c:1540:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 1540 | void __weak arch_klp_code_modify_prepare(void) | ^ | static kernel/livepatch/core.c:1544:13: warning: no previous prototype for function 'arch_klp_code_modify_post_process' [-Wmissing-prototypes] 1544 | void __weak arch_klp_code_modify_post_process(void) | ^ kernel/livepatch/core.c:1544:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 1544 | void __weak arch_klp_code_modify_post_process(void) | ^ | static kernel/livepatch/core.c:1548:14: warning: no previous prototype for function 'arch_klp_mem_alloc' [-Wmissing-prototypes] 1548 | void __weak *arch_klp_mem_alloc(size_t size) | ^ kernel/livepatch/core.c:1548:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 1548 | void __weak *arch_klp_mem_alloc(size_t size) | ^ | static kernel/livepatch/core.c:1553:13: warning: no previous prototype for function 'arch_klp_mem_free' [-Wmissing-prototypes] 1553 | void __weak arch_klp_mem_free(void *mem) | ^ kernel/livepatch/core.c:1553:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 1553 | void __weak arch_klp_mem_free(void *mem) | ^ | static kernel/livepatch/core.c:1581:13: warning: no previous prototype for function 'arch_klp_set_brk_func' [-Wmissing-prototypes] 1581 | void __weak arch_klp_set_brk_func(struct klp_func_node *func_node, void *new_func) | ^ kernel/livepatch/core.c:1581:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 1581 | void __weak arch_klp_set_brk_func(struct klp_func_node *func_node, void *new_func) | ^ | static kernel/livepatch/core.c:1993:5: warning: no previous prototype for function 'klp_try_enable_patch' [-Wmissing-prototypes] 1993 | int klp_try_enable_patch(void *data) | ^ kernel/livepatch/core.c:1993:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 1993 | int klp_try_enable_patch(void *data) | ^ | static 13 warnings generated.
vim +/arch_klp_check_calltrace +315 arch/x86/kernel/livepatch.c
314
315 int arch_klp_check_calltrace(bool (*check_func)(void *, int *, unsigned long), void *data)
316 { 317 return do_check_calltrace(check_func, data); 318 } 319