[PATCH] bpf: remove redundant intiialization of variable stype

Subsystems: bpf [general] (safe dynamic programs and tools), the rest

STALE1866d LANDED

Landed in mainline as 724f17b7d45d on 2021-07-22.

2 messages, 2 authors, 2021-07-22 · open the first message on its own page

[PATCH] bpf: remove redundant intiialization of variable stype

From: Colin King <hidden>
Date: 2021-07-21 12:03:53

From: Colin Ian King <redacted>

The variable stype is being initialized with a value that is never
read, it is being updated later on. The assignment is redundant and
can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <redacted>
---
 kernel/bpf/local_storage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/bpf/local_storage.c b/kernel/bpf/local_storage.c
index 362e81481594..7ed2a14dc0de 100644
--- a/kernel/bpf/local_storage.c
+++ b/kernel/bpf/local_storage.c
@@ -406,7 +406,7 @@ static int cgroup_storage_check_btf(const struct bpf_map *map,
 static void cgroup_storage_seq_show_elem(struct bpf_map *map, void *key,
 					 struct seq_file *m)
 {
-	enum bpf_cgroup_storage_type stype = cgroup_storage_type(map);
+	enum bpf_cgroup_storage_type stype;
 	struct bpf_cgroup_storage *storage;
 	int cpu;
 
-- 
2.31.1

Re: [PATCH] bpf: remove redundant intiialization of variable stype

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-07-22 23:50:18

Hello:

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

On Wed, 21 Jul 2021 12:56:30 +0100 you wrote:
From: Colin Ian King <redacted>

The variable stype is being initialized with a value that is never
read, it is being updated later on. The assignment is redundant and
can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <redacted>

[...]
Here is the summary with links:
  - bpf: remove redundant intiialization of variable stype
    https://git.kernel.org/bpf/bpf-next/c/724f17b7d45d

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

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