BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next v2 1/3] bpf, arm64: Simplify if logic in emit_lse_atomic()
@ 2025-01-03  2:02 Peilin Ye
  2025-01-03  2:03 ` [PATCH bpf-next v2 2/3] bpf, arm64: Factor out emit_a64_add_i() Peilin Ye
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Peilin Ye @ 2025-01-03  2:02 UTC (permalink / raw)
  To: bpf
  Cc: Peilin Ye, Xu Kuohai, Alexei Starovoitov, Daniel Borkmann,
	Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
	Yonghong Song, John Fastabend, KP Singh, Stanislav Fomichev,
	Hao Luo, Jiri Olsa, Puranjay Mohan, Catalin Marinas, Will Deacon,
	Josh Don, Barret Rhoden, linux-arm-kernel, linux-kernel

Delete that unnecessary outer if clause.  No functional change.

Signed-off-by: Peilin Ye <yepeilin@google.com>
---
 arch/arm64/net/bpf_jit_comp.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
index 66708b95493a..9040033eb1ea 100644
--- a/arch/arm64/net/bpf_jit_comp.c
+++ b/arch/arm64/net/bpf_jit_comp.c
@@ -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) {
-- 
2.47.1.613.gc27f4b7a9f-goog


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-01-06 14:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-03  2:02 [PATCH bpf-next v2 1/3] bpf, arm64: Simplify if logic in emit_lse_atomic() Peilin Ye
2025-01-03  2:03 ` [PATCH bpf-next v2 2/3] bpf, arm64: Factor out emit_a64_add_i() Peilin Ye
2025-01-03  2:04 ` [PATCH bpf-next v2 3/3] bpf, arm64: Emit A64_{ADD,SUB}_I when possible in emit_{lse,ll_sc}_atomic() Peilin Ye
2025-01-06  6:42 ` [PATCH bpf-next v2 1/3] bpf, arm64: Simplify if logic in emit_lse_atomic() Xu Kuohai
2025-01-06 14:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox