include/linux/ftrace.h:138:9: error: call to undeclared function 'arch_ftrace_get_regs'; ISO C99 and later do not support implicit function declarations

kernel test robot
2024-12-21T19:39:39Z

head: baa172c77ac52b2058ba3abae7512b7b16d0c461
commit: 7caa9765465f60b6d88e22264892cee12d971888 ftrace: riscv: move from REGS to ARGS
date: 7 months ago
config: riscv-randconfig-001-20241222 (https://download.01.org/0day-ci/archive/20241222/202412220318.Yh8KEauV-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 9daf10ff8f29ba3a88a105aaa9d2379c21b77d35)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241222/202412220318.Yh8KEauV-lkp@intel.com/reproduce)

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/202412220318.Yh8KEauV-lkp@intel.com/

All errors (new ones prefixed by >>):

In file included from arch/riscv/kernel/asm-offsets.c:10:
In file included from include/linux/mm.h:2253:
include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
514 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
In file included from arch/riscv/kernel/asm-offsets.c:12:
>> include/linux/ftrace.h:138:9: error: call to undeclared function 'arch_ftrace_get_regs'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
138 | return arch_ftrace_get_regs(fregs);
| ^
include/linux/ftrace.h:138:9: note: did you mean 'ftrace_get_regs'?
include/linux/ftrace.h:133:40: note: 'ftrace_get_regs' declared here
133 | static __always_inline struct pt_regs *ftrace_get_regs(struct ftrace_regs *fregs)
| ^
134 | {
135 | if (!fregs)
136 | return NULL;
137 |
138 | return arch_ftrace_get_regs(fregs);
| ~~~~~~~~~~~~~~~~~~~~
| ftrace_get_regs
>> include/linux/ftrace.h:138:9: error: incompatible integer to pointer conversion returning 'int' from a function with result type 'struct pt_regs *' [-Wint-conversion]
138 | return arch_ftrace_get_regs(fregs);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 2 errors generated.
make[3]: *** [scripts/Makefile.build:117: arch/riscv/kernel/asm-offsets.s] Error 1 shuffle=1151473207
make[3]: Target 'prepare' not remade because of errors.
make[2]: *** [Makefile:1203: prepare0] Error 2 shuffle=1151473207
make[2]: Target 'prepare' not remade because of errors.
make[1]: *** [Makefile:240: __sub-make] Error 2 shuffle=1151473207
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:240: __sub-make] Error 2 shuffle=1151473207