bpf: use BPF_CAST_CALL for casting bpf call
authorPrashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
Tue, 16 Apr 2019 09:13:01 +0000 (18:13 +0900)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 17 Apr 2019 02:28:31 +0000 (19:28 -0700)
verifier.c uses BPF_CAST_CALL for casting bpf call except at one
place in jit_subprogs(). Let's use the macro for consistency.

Signed-off-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/verifier.c

index c7220153c5b1b6e69607321d55303caf9ca2404f..db301e9b5295022e63c1b731b6fc9a8e25e95a5d 100644 (file)
@@ -7647,9 +7647,8 @@ static int jit_subprogs(struct bpf_verifier_env *env)
                            insn->src_reg != BPF_PSEUDO_CALL)
                                continue;
                        subprog = insn->off;
-                       insn->imm = (u64 (*)(u64, u64, u64, u64, u64))
-                               func[subprog]->bpf_func -
-                               __bpf_call_base;
+                       insn->imm = BPF_CAST_CALL(func[subprog]->bpf_func) -
+                                   __bpf_call_base;
                }
 
                /* we use the aux data to keep a list of the start addresses