[jolsa-perf:kprobe/multi 8/13] kernel/bpf/syscall.c:3099:32: warning: initialization of 'struct kretprobe *' from 'int' makes pointer from integer without a cast

From: kernel test robot
Date: Mon Dec 27 2021 - 11:57:39 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git kprobe/multi
head: bc59262730d5cfc95d6cae84f247d2e8690a309b
commit: 9308a22da930865f9cc80a47f3d0ced38aae1a0a [8/13] bpf: Add kprobe link for attaching raw kprobes
config: nds32-randconfig-r032-20211227 (https://download.01.org/0day-ci/archive/20211228/202112280010.ufkJQV03-lkp@xxxxxxxxx/config)
compiler: nds32le-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git/commit/?id=9308a22da930865f9cc80a47f3d0ced38aae1a0a
git remote add jolsa-perf https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
git fetch --no-tags jolsa-perf kprobe/multi
git checkout 9308a22da930865f9cc80a47f3d0ced38aae1a0a
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=nds32 SHELL=/bin/bash kernel/bpf/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

kernel/bpf/syscall.c: In function 'bpf_perf_link_attach':
kernel/bpf/syscall.c:3021:17: error: 'ENOTSUP' undeclared (first use in this function); did you mean 'ENOTSUPP'?
3021 | return -ENOTSUP;
| ^~~~~~~
| ENOTSUPP
kernel/bpf/syscall.c:3021:17: note: each undeclared identifier is reported only once for each function it appears in
kernel/bpf/syscall.c: In function 'kretprobe_dispatcher':
kernel/bpf/syscall.c:3099:32: error: implicit declaration of function 'get_kretprobe'; did you mean 'get_kprobe'? [-Werror=implicit-function-declaration]
3099 | struct kretprobe *rp = get_kretprobe(ri);
| ^~~~~~~~~~~~~
| get_kprobe
>> kernel/bpf/syscall.c:3099:32: warning: initialization of 'struct kretprobe *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
kernel/bpf/syscall.c: In function 'bpf_perf_link_attach':
kernel/bpf/syscall.c:3022:1: error: control reaches end of non-void function [-Werror=return-type]
3022 | }
| ^
cc1: some warnings being treated as errors


vim +3099 kernel/bpf/syscall.c

3095
3096 static int
3097 kretprobe_dispatcher(struct kretprobe_instance *ri, struct pt_regs *regs)
3098 {
> 3099 struct kretprobe *rp = get_kretprobe(ri);
3100 struct bpf_kprobe_link *kprobe_link;
3101
3102 kprobe_link = container_of(rp, struct bpf_kprobe_link, rp);
3103 return kprobe_link_prog_run(kprobe_link, regs);
3104 }
3105

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx