Skip to content

Commit 0a58072

Browse files
peilin-yeborkmann
authored andcommitted
bpf, arm64: Simplify if logic in emit_lse_atomic()
Delete that unnecessary outer if clause. No functional change. Signed-off-by: Peilin Ye <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Xu Kuohai <[email protected]> Link: https://lore.kernel.org/bpf/e8520e5503a489e2dea8526077976ae5a0ab1849.1735868489.git.yepeilin@google.com
1 parent 73b9075 commit 0a58072

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

arch/arm64/net/bpf_jit_comp.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -648,16 +648,14 @@ static int emit_lse_atomic(const struct bpf_insn *insn, struct jit_ctx *ctx)
648648
const s16 off = insn->off;
649649
u8 reg = dst;
650650

651-
if (off || arena) {
652-
if (off) {
653-
emit_a64_mov_i(1, tmp, off, ctx);
654-
emit(A64_ADD(1, tmp, tmp, dst), ctx);
655-
reg = tmp;
656-
}
657-
if (arena) {
658-
emit(A64_ADD(1, tmp, reg, arena_vm_base), ctx);
659-
reg = tmp;
660-
}
651+
if (off) {
652+
emit_a64_mov_i(1, tmp, off, ctx);
653+
emit(A64_ADD(1, tmp, tmp, dst), ctx);
654+
reg = tmp;
655+
}
656+
if (arena) {
657+
emit(A64_ADD(1, tmp, reg, arena_vm_base), ctx);
658+
reg = tmp;
661659
}
662660

663661
switch (insn->imm) {

0 commit comments

Comments
 (0)