bpf, arm64: Simplify if logic in emit_lse_atomic()
authorPeilin Ye <yepeilin@google.com>
Fri, 3 Jan 2025 02:02:53 +0000 (02:02 +0000)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 6 Jan 2025 14:07:20 +0000 (15:07 +0100)
Delete that unnecessary outer if clause. No functional change.

Signed-off-by: Peilin Ye <yepeilin@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Xu Kuohai <xukuohai@huawei.com>
Link: https://lore.kernel.org/bpf/e8520e5503a489e2dea8526077976ae5a0ab1849.1735868489.git.yepeilin@google.com
arch/arm64/net/bpf_jit_comp.c

index 66708b95493a43ad9d8ce6b6e64da648365bd3b8..9040033eb1eab57a7e10d39f007c38ab93436611 100644 (file)
@@ -648,16 +648,14 @@ static int emit_lse_atomic(const struct bpf_insn *insn, struct jit_ctx *ctx)
        const s16 off = insn->off;
        u8 reg = dst;
 
-       if (off || arena) {
-               if (off) {
-                       emit_a64_mov_i(1, tmp, off, ctx);
-                       emit(A64_ADD(1, tmp, tmp, dst), ctx);
-                       reg = tmp;
-               }
-               if (arena) {
-                       emit(A64_ADD(1, tmp, reg, arena_vm_base), ctx);
-                       reg = tmp;
-               }
+       if (off) {
+               emit_a64_mov_i(1, tmp, off, ctx);
+               emit(A64_ADD(1, tmp, tmp, dst), ctx);
+               reg = tmp;
+       }
+       if (arena) {
+               emit(A64_ADD(1, tmp, reg, arena_vm_base), ctx);
+               reg = tmp;
        }
 
        switch (insn->imm) {