[PATCH] bpf, x86:remove unneeded variable

Subsystems: bpf jit for x86 32-bit, bpf [general] (safe dynamic programs and tools), the rest, x86 architecture (32-bit and 64-bit)

STALE1778d

2 messages, 2 authors, 2021-11-03 · open the first message on its own page

[PATCH] bpf, x86:remove unneeded variable

From: <hidden>
Date: 2021-11-03 05:47:37

From: Zhang Mingyu <redacted>

Fix the following coccinelle REVIEW:
./arch/x86/net/bpf_jit_comp32.c:1274:5-8

Reported-by: Zeal Robot <redacted>
Signed-off-by: Zhang Mingyu <redacted>
---
 arch/x86/net/bpf_jit_comp32.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/x86/net/bpf_jit_comp32.c b/arch/x86/net/bpf_jit_comp32.c
index da9b7cfa4632..bce7b9b5a653 100644
--- a/arch/x86/net/bpf_jit_comp32.c
+++ b/arch/x86/net/bpf_jit_comp32.c
@@ -1271,7 +1271,6 @@ static void emit_epilogue(u8 **pprog, u32 stack_depth)
 static int emit_jmp_edx(u8 **pprog, u8 *ip)
 {
 	u8 *prog = *pprog;
-	int cnt = 0;
 
 #ifdef CONFIG_RETPOLINE
 	EMIT1_off32(0xE9, (u8 *)__x86_indirect_thunk_edx - (ip + 5));
@@ -1280,7 +1279,7 @@ static int emit_jmp_edx(u8 **pprog, u8 *ip)
 #endif
 	*pprog = prog;
 
-	return cnt;
+	return 0;
 }
 
 /*
-- 
2.25.1

Re: [PATCH] bpf, x86:remove unneeded variable

From: Alexei Starovoitov <hidden>
Date: 2021-11-03 05:52:39

On Tue, Nov 2, 2021 at 10:47 PM [off-list ref] wrote:
From: Zhang Mingyu <redacted>

Fix the following coccinelle REVIEW:
./arch/x86/net/bpf_jit_comp32.c:1274:5-8
trash that checker and please send patches after you tested them.
quoted hunk
Reported-by: Zeal Robot <redacted>
Signed-off-by: Zhang Mingyu <redacted>
---
 arch/x86/net/bpf_jit_comp32.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/x86/net/bpf_jit_comp32.c b/arch/x86/net/bpf_jit_comp32.c
index da9b7cfa4632..bce7b9b5a653 100644
--- a/arch/x86/net/bpf_jit_comp32.c
+++ b/arch/x86/net/bpf_jit_comp32.c
@@ -1271,7 +1271,6 @@ static void emit_epilogue(u8 **pprog, u32 stack_depth)
 static int emit_jmp_edx(u8 **pprog, u8 *ip)
 {
        u8 *prog = *pprog;
-       int cnt = 0;

 #ifdef CONFIG_RETPOLINE
        EMIT1_off32(0xE9, (u8 *)__x86_indirect_thunk_edx - (ip + 5));
@@ -1280,7 +1279,7 @@ static int emit_jmp_edx(u8 **pprog, u8 *ip)
 #endif
        *pprog = prog;

-       return cnt;
+       return 0;
 }

 /*
--
2.25.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help