kernel/bpf/task_iter.c:940:9: warning: return makes pointer from integer without a cast
kernel test robot
build bottree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: fe1998aa935b44ef873193c0772c43bce74f17dc commit: 9c66dc94b62aef23300f05f63404afb8990920b4 [10579/14992] bpf: Introduce css_task open-coded iterator kfuncs config: i386-buildonly-randconfig-006-20231026 (https://download.01.org/0day-ci/archive/20231026/[email protected]/config) compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231026/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
kernel/bpf/task_iter.c:831:17: warning: no previous declaration for 'bpf_iter_task_vma_new' [-Wmissing-declarations]
__bpf_kfunc int bpf_iter_task_vma_new(struct bpf_iter_task_vma *it,
^~~~~~~~~~~~~~~~~~~~~
kernel/bpf/task_iter.c:875:36: warning: no previous declaration for 'bpf_iter_task_vma_next' [-Wmissing-declarations]
__bpf_kfunc struct vm_area_struct *bpf_iter_task_vma_next(struct bpf_iter_task_vma *it)
^~~~~~~~~~~~~~~~~~~~~~
kernel/bpf/task_iter.c:884:18: warning: no previous declaration for 'bpf_iter_task_vma_destroy' [-Wmissing-declarations]
__bpf_kfunc void bpf_iter_task_vma_destroy(struct bpf_iter_task_vma *it)
^~~~~~~~~~~~~~~~~~~~~~~~~
kernel/bpf/task_iter.c:909:17: warning: no previous declaration for 'bpf_iter_css_task_new' [-Wmissing-declarations]
__bpf_kfunc int bpf_iter_css_task_new(struct bpf_iter_css_task *it,
^~~~~~~~~~~~~~~~~~~~~
kernel/bpf/task_iter.c: In function 'bpf_iter_css_task_new':
kernel/bpf/task_iter.c:919:7: error: 'CSS_TASK_ITER_PROCS' undeclared (first use in this function); did you mean 'BPF_TASK_ITER_TGID'?
case CSS_TASK_ITER_PROCS | CSS_TASK_ITER_THREADED:
^~~~~~~~~~~~~~~~~~~
BPF_TASK_ITER_TGID
kernel/bpf/task_iter.c:919:7: note: each undeclared identifier is reported only once for each function it appears in kernel/bpf/task_iter.c:919:29: error: 'CSS_TASK_ITER_THREADED' undeclared (first use in this function); did you mean 'CSS_TASK_ITER_PROCS'?
case CSS_TASK_ITER_PROCS | CSS_TASK_ITER_THREADED:
^~~~~~~~~~~~~~~~~~~~~~
CSS_TASK_ITER_PROCS
kernel/bpf/task_iter.c:927:53: error: invalid application of 'sizeof' to incomplete type 'struct css_task_iter'
kit->css_it = bpf_mem_alloc(&bpf_global_ma, sizeof(struct css_task_iter));
^~~~~~
kernel/bpf/task_iter.c:930:2: error: implicit declaration of function 'css_task_iter_start'; did you mean '__sg_page_iter_start'? [-Werror=implicit-function-declaration]
css_task_iter_start(css, flags, kit->css_it);
^~~~~~~~~~~~~~~~~~~
__sg_page_iter_start
kernel/bpf/task_iter.c: At top level:
kernel/bpf/task_iter.c:934:33: warning: no previous declaration for 'bpf_iter_css_task_next' [-Wmissing-declarations]
__bpf_kfunc struct task_struct *bpf_iter_css_task_next(struct bpf_iter_css_task *it)
^~~~~~~~~~~~~~~~~~~~~~
kernel/bpf/task_iter.c: In function 'bpf_iter_css_task_next':
kernel/bpf/task_iter.c:940:9: error: implicit declaration of function 'css_task_iter_next'; did you mean '__sg_page_iter_next'? [-Werror=implicit-function-declaration]
return css_task_iter_next(kit->css_it);
^~~~~~~~~~~~~~~~~~
__sg_page_iter_next
>> kernel/bpf/task_iter.c:940:9: warning: return makes pointer from integer without a cast [-Wint-conversion]
return css_task_iter_next(kit->css_it);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/bpf/task_iter.c: At top level:
kernel/bpf/task_iter.c:943:18: warning: no previous declaration for 'bpf_iter_css_task_destroy' [-Wmissing-declarations]
__bpf_kfunc void bpf_iter_css_task_destroy(struct bpf_iter_css_task *it)
^~~~~~~~~~~~~~~~~~~~~~~~~
kernel/bpf/task_iter.c: In function 'bpf_iter_css_task_destroy':
kernel/bpf/task_iter.c:949:2: error: implicit declaration of function 'css_task_iter_end'; did you mean 'vma_iter_end'? [-Werror=implicit-function-declaration]
css_task_iter_end(kit->css_it);
^~~~~~~~~~~~~~~~~
vma_iter_endcc1: some warnings being treated as errors
vim +940 kernel/bpf/task_iter.c
933
934 __bpf_kfunc struct task_struct *bpf_iter_css_task_next(struct bpf_iter_css_task *it)
935 {
936 struct bpf_iter_css_task_kern *kit = (void *)it;
937
938 if (!kit->css_it)
939 return NULL;
> 940 return css_task_iter_next(kit->css_it);
941 }
942
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki