diff mbox series

[bpf-next] bpf, arm64: Remove redundant switch case about BPF_DIV and BPF_MOD

Message ID 1621328170-17583-1-git-send-email-yangtiezhu@loongson.cn (mailing list archive)
State Accepted
Commit 119220d81258c1e79db9aa7b52ef09b945aaf46f
Delegated to: BPF
Headers show
Series [bpf-next] bpf, arm64: Remove redundant switch case about BPF_DIV and BPF_MOD | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for bpf-next
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 14 of 14 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 21 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

Tiezhu Yang May 18, 2021, 8:56 a.m. UTC
After commit 96a71005bdcb ("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 <yangtiezhu@loongson.cn>
---
 arch/arm64/net/bpf_jit_comp.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org May 18, 2021, 2:50 p.m. UTC | #1
Hello:

This patch was applied to bpf/bpf-next.git (refs/heads/master):

On Tue, 18 May 2021 16:56:10 +0800 you wrote:
> After commit 96a71005bdcb ("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 <yangtiezhu@loongson.cn>
> ---
>  arch/arm64/net/bpf_jit_comp.c | 13 ++++---------
>  1 file changed, 4 insertions(+), 9 deletions(-)

Here is the summary with links:
  - [bpf-next] bpf, arm64: Remove redundant switch case about BPF_DIV and BPF_MOD
    https://git.kernel.org/bpf/bpf-next/c/119220d81258

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
diff mbox series

Patch

diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
index 9785026..be873a7 100644
--- a/arch/arm64/net/bpf_jit_comp.c
+++ b/arch/arm64/net/bpf_jit_comp.c
@@ -485,17 +485,12 @@  static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx,
 		break;
 	case BPF_ALU | BPF_DIV | BPF_X:
 	case BPF_ALU64 | BPF_DIV | BPF_X:
+		emit(A64_UDIV(is64, dst, dst, src), ctx);
+		break;
 	case BPF_ALU | BPF_MOD | BPF_X:
 	case BPF_ALU64 | BPF_MOD | BPF_X:
-		switch (BPF_OP(code)) {
-		case BPF_DIV:
-			emit(A64_UDIV(is64, dst, dst, src), ctx);
-			break;
-		case BPF_MOD:
-			emit(A64_UDIV(is64, tmp, dst, src), ctx);
-			emit(A64_MSUB(is64, dst, dst, tmp, src), ctx);
-			break;
-		}
+		emit(A64_UDIV(is64, tmp, dst, src), ctx);
+		emit(A64_MSUB(is64, dst, dst, tmp, src), ctx);
 		break;
 	case BPF_ALU | BPF_LSH | BPF_X:
 	case BPF_ALU64 | BPF_LSH | BPF_X: