Skip to contentSkip to conversation

bpf: Remove insn_buf[] declaration in inner block

PATCH Applied Jianlin Lv 2 participants 2 messages Mar 18, 2021 – Mar 19, 2021

Subsystems (4)
lore
Share & tools
lore

Jianlin Lv

author
#0 lore raw

PATCH 1/1 bpf: Remove insn_buf[] declaration in inner block

Two insn_buf[16] variables are declared in the function, which act on function scope and block scope respectively.
The statement in the inner blocks is redundant, so remove it.

---
 kernel/bpf/verifier.c | 1 -
 1 file changed, 1 deletion(-)
kernel/bpf/verifier.c +0 -1
index f9096b049cd6..e26c5170c953 100644
@@ -11899,7 +11899,6 @@ static int do_misc_fixups(struct bpf_verifier_env *env)
 		    insn->code == (BPF_ALU64 | BPF_SUB | BPF_X)) {
 			const u8 code_add = BPF_ALU64 | BPF_ADD | BPF_X;
 			const u8 code_sub = BPF_ALU64 | BPF_SUB | BPF_X;
-			struct bpf_insn insn_buf[16];
 			struct bpf_insn *patch = &insn_buf[0];
 			bool issrc, isneg;
 			u32 off_reg;
Signature · 1 line
2.25.1
#1 lore raw
This patch was applied to bpf/bpf-next.git (refs/heads/master):

Hello:

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

Quoted 8 lines · On Thu, 18 Mar 2021 10:48:51 +0800 you wrote:

Two insn_buf[16] variables are declared in the function, which act on function scope and block scope respectively.
The statement in the inner blocks is redundant, so remove it.

---
 kernel/bpf/verifier.c | 1 -
 1 file changed, 1 deletion(-)

Here is the summary with links:
- [bpf-next] bpf: Remove insn_buf[] declaration in inner block

    https://git.kernel.org/bpf/bpf-next/c/9ef05281e5d0

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