Skip to content

Commit 119220d

Browse files
seehearfeelborkmann
authored andcommitted
bpf, arm64: Remove redundant switch case about BPF_DIV and BPF_MOD
After commit 96a7100 ("bpf, arm64: remove obsolete exception handling from div/mod"), there is no need to check twice about BPF_DIV and BPF_MOD, remove the redundant switch case. Signed-off-by: Tiezhu Yang <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent f18ba26 commit 119220d

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

arch/arm64/net/bpf_jit_comp.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -485,17 +485,12 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx,
485485
break;
486486
case BPF_ALU | BPF_DIV | BPF_X:
487487
case BPF_ALU64 | BPF_DIV | BPF_X:
488+
emit(A64_UDIV(is64, dst, dst, src), ctx);
489+
break;
488490
case BPF_ALU | BPF_MOD | BPF_X:
489491
case BPF_ALU64 | BPF_MOD | BPF_X:
490-
switch (BPF_OP(code)) {
491-
case BPF_DIV:
492-
emit(A64_UDIV(is64, dst, dst, src), ctx);
493-
break;
494-
case BPF_MOD:
495-
emit(A64_UDIV(is64, tmp, dst, src), ctx);
496-
emit(A64_MSUB(is64, dst, dst, tmp, src), ctx);
497-
break;
498-
}
492+
emit(A64_UDIV(is64, tmp, dst, src), ctx);
493+
emit(A64_MSUB(is64, dst, dst, tmp, src), ctx);
499494
break;
500495
case BPF_ALU | BPF_LSH | BPF_X:
501496
case BPF_ALU64 | BPF_LSH | BPF_X:

0 commit comments

Comments
 (0)