summaryrefslogtreecommitdiff
path: root/tools/lib/bpf/libbpf.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lib/bpf/libbpf.c')
-rw-r--r--tools/lib/bpf/libbpf.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 829d62a3ad5f..0bc1fd813408 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -5840,14 +5840,12 @@ static int bpf_object__collect_reloc(struct bpf_object *obj)
static bool insn_is_helper_call(struct bpf_insn *insn, enum bpf_func_id *func_id)
{
- __u8 class = BPF_CLASS(insn->code);
-
- if ((class == BPF_JMP || class == BPF_JMP32) &&
+ if (BPF_CLASS(insn->code) == BPF_JMP &&
BPF_OP(insn->code) == BPF_CALL &&
BPF_SRC(insn->code) == BPF_K &&
- insn->src_reg == 0 && insn->dst_reg == 0) {
- if (func_id)
- *func_id = insn->imm;
+ insn->src_reg == 0 &&
+ insn->dst_reg == 0) {
+ *func_id = insn->imm;
return true;
}
return false;