Re: [PATCH bpf-next v1 3/8] bpf: Support for kfuncs with KF_MAGIC_ARGS

kernel test robot
2025-10-30T12:00:13Z

Hi Ihor,

kernel test robot noticed the following build warnings:

[auto build test WARNING on bpf-next/master]

url: https://github.com/intel-lab-lkp/linux/commits/Ihor-Solodrai/bpf-Add-BTF_ID_LIST_END-and-BTF_ID_LIST_SIZE-macros/20251030-030608
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link: https://lore.kernel.org/r/20251029190113.3323406-4-ihor.solodrai%40linux.dev
patch subject: [PATCH bpf-next v1 3/8] bpf: Support for kfuncs with KF_MAGIC_ARGS
config: s390-randconfig-001-20251030 (https://download.01.org/0day-ci/archive/20251030/202510301923.XmrKra1o-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251030/202510301923.XmrKra1o-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/202510301923.XmrKra1o-lkp@intel.com/

All warnings (new ones prefixed by >>):

kernel/bpf/verifier.c:3273:1: error: invalid storage class specifier in function declarator
3273 | static s32 magic_kfunc_by_impl(s32 impl_func_id)
| ^
kernel/bpf/verifier.c:3273:12: error: parameter named 'magic_kfunc_by_impl' is missing
3273 | static s32 magic_kfunc_by_impl(s32 impl_func_id)
| ^
kernel/bpf/verifier.c:3273:49: error: expected ';' at end of declaration
3273 | static s32 magic_kfunc_by_impl(s32 impl_func_id)
| ^
| ;
kernel/bpf/verifier.c:3271:17: error: parameter 'magic_kfuncs' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
3271 | BTF_ID_LIST_END(magic_kfuncs)
| ^
3272 |
3273 | static s32 magic_kfunc_by_impl(s32 impl_func_id)
3274 | {
kernel/bpf/verifier.c:3271:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
3271 | BTF_ID_LIST_END(magic_kfuncs)
| ^
| int
kernel/bpf/verifier.c:3277:18: error: call to undeclared function 'BTF_ID_LIST_SIZE'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
3277 | for (i = 1; i < BTF_ID_LIST_SIZE(magic_kfuncs); i += 2) {
| ^
kernel/bpf/verifier.c:3277:18: note: did you mean 'BTF_ID_LIST_END'?
kernel/bpf/verifier.c:3271:1: note: 'BTF_ID_LIST_END' declared here
3271 | BTF_ID_LIST_END(magic_kfuncs)
| ^
3272 |
3273 | static s32 magic_kfunc_by_impl(s32 impl_func_id)
3274 | {
3275 | int i;
3276 |
3277 | for (i = 1; i < BTF_ID_LIST_SIZE(magic_kfuncs); i += 2) {
| ~~~~~~~~~~~~~~~~
| BTF_ID_LIST_END
kernel/bpf/verifier.c:3278:19: error: subscripted value is not an array, pointer, or vector
3278 | if (magic_kfuncs[i] == impl_func_id)
| ~~~~~~~~~~~~^~
kernel/bpf/verifier.c:3278:26: error: use of undeclared identifier 'impl_func_id'
3278 | if (magic_kfuncs[i] == impl_func_id)
| ^
kernel/bpf/verifier.c:3279:23: error: subscripted value is not an array, pointer, or vector
3279 | return magic_kfuncs[i - 1];
| ~~~~~~~~~~~~^~~~~~
>> kernel/bpf/verifier.c:3271:1: warning: no previous prototype for function 'BTF_ID_LIST_END' [-Wmissing-prototypes]
3271 | BTF_ID_LIST_END(magic_kfuncs)
| ^
kernel/bpf/verifier.c:3271:16: note: declare 'static' if the function is not intended to be used outside of this translation unit
3271 | BTF_ID_LIST_END(magic_kfuncs)
| ^
| static
kernel/bpf/verifier.c:3271:1: error: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
3271 | BTF_ID_LIST_END(magic_kfuncs)
| ^
kernel/bpf/verifier.c:3288:18: error: call to undeclared function 'BTF_ID_LIST_SIZE'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
3288 | for (i = 0; i < BTF_ID_LIST_SIZE(magic_kfuncs); i += 2) {
| ^
kernel/bpf/verifier.c:3409:17: error: call to undeclared function 'magic_kfunc_by_impl'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
3409 | tmp_func_id = magic_kfunc_by_impl(func_id);
| ^
kernel/bpf/verifier.c:13726:17: error: call to undeclared function 'magic_kfunc_by_impl'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
13726 | tmp_func_id = magic_kfunc_by_impl(func_id);
| ^
1 warning and 13 errors generated.

vim +/BTF_ID_LIST_END +3271 kernel/bpf/verifier.c

3265
3266 /*
3267 * magic_kfuncs is used as a list of (foo, foo_impl) pairs
3268 */
3269 BTF_ID_LIST(magic_kfuncs)
3270 BTF_ID_UNUSED
> 3271 BTF_ID_LIST_END(magic_kfuncs)
3272

--
0-DAY CI Kernel Test Service