Commit 85393a1
bpf: suppress -Wcast-function-type warning
Building with -Wextra shows lots of warnings in the bpf
code such as
kernel/bpf/verifier.c: In function ‘jit_subprogs’:
include/linux/filter.h:345:4: warning: cast between incompatible function types from ‘unsigned int (*)(const void *, const struct bpf_insn *)’ to ‘u64 (*)(u64, u64, u64, u64, u64)’ {aka ‘long long unsigned int (*)(long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int, long long unsigned int)’} [-Wcast-function-type]
345 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
| ^
kernel/bpf/verifier.c:10706:16: note: in expansion of macro ‘BPF_CAST_CALL’
10706 | insn->imm = BPF_CAST_CALL(func[subprog]->bpf_func) -
| ^~~~~~~~~~~~~
This appears to be intentional, so change the cast in a way that
suppresses the warning.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Andrii Nakryiko <andrii@kernel.org>1 parent 44bfa52 commit 85393a1
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
345 | | - | |
| 345 | + | |
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
| |||
0 commit comments