Skip to content

Commit f45b297

Browse files
Björn Töpelborkmann
authored andcommitted
bpf, x86: Fix "no previous prototype" warning
The arch_prepare_bpf_dispatcher function does not have a prototype, and yields the following warning when W=1 is enabled for the kernel build. >> arch/x86/net/bpf_jit_comp.c:2188:5: warning: no previous \ prototype for 'arch_prepare_bpf_dispatcher' [-Wmissing-prototypes] 2188 | int arch_prepare_bpf_dispatcher(void *image, s64 *funcs, \ int num_funcs) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ Remove the warning by adding a function declaration to include/linux/bpf.h. Fixes: 75ccbef ("bpf: Introduce BPF dispatcher") Reported-by: kernel test robot <[email protected]> Signed-off-by: Björn Töpel <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 3751c3d commit f45b297

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

include/linux/bpf.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,7 @@ int bpf_trampoline_unlink_prog(struct bpf_prog *prog, struct bpf_trampoline *tr)
732732
struct bpf_trampoline *bpf_trampoline_get(u64 key,
733733
struct bpf_attach_target_info *tgt_info);
734734
void bpf_trampoline_put(struct bpf_trampoline *tr);
735+
int arch_prepare_bpf_dispatcher(void *image, s64 *funcs, int num_funcs);
735736
#define BPF_DISPATCHER_INIT(_name) { \
736737
.mutex = __MUTEX_INITIALIZER(_name.mutex), \
737738
.func = &_name##_func, \

0 commit comments

Comments
 (0)