[PATCH] bpf: remove redundant assignment of variable id

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

STALE1975d LANDED

Landed in mainline as 235fc0e36d35 on 2021-03-30.

4 messages, 4 authors, 2021-03-30 · open the first message on its own page

[PATCH] bpf: remove redundant assignment of variable id

From: Colin King <hidden>
Date: 2021-03-26 19:44:37

From: Colin Ian King <redacted>

The variable id is being assigned a value that is never
read, the assignment is redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <redacted>
---
 kernel/bpf/btf.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
index 369faeddf1df..b22fb29347c0 100644
--- a/kernel/bpf/btf.c
+++ b/kernel/bpf/btf.c
@@ -789,7 +789,6 @@ static const struct btf_type *btf_type_skip_qualifiers(const struct btf *btf,
 
 	while (btf_type_is_modifier(t) &&
 	       BTF_INFO_KIND(t->info) != BTF_KIND_TYPEDEF) {
-		id = t->type;
 		t = btf_type_by_id(btf, t->type);
 	}
 
-- 
2.30.2

Re: [PATCH] bpf: remove redundant assignment of variable id

From: Song Liu <song@kernel.org>
Date: 2021-03-26 20:19:45

On Fri, Mar 26, 2021 at 12:45 PM Colin King [off-list ref] wrote:
From: Colin Ian King <redacted>

The variable id is being assigned a value that is never
read, the assignment is redundant and can be removed.

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

For future patches, please prefix it as [PATCH bpf-next] for
[PATCH bpf], based on which tree the patch should apply to.
quoted hunk
---
 kernel/bpf/btf.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
index 369faeddf1df..b22fb29347c0 100644
--- a/kernel/bpf/btf.c
+++ b/kernel/bpf/btf.c
@@ -789,7 +789,6 @@ static const struct btf_type *btf_type_skip_qualifiers(const struct btf *btf,

        while (btf_type_is_modifier(t) &&
               BTF_INFO_KIND(t->info) != BTF_KIND_TYPEDEF) {
-               id = t->type;
                t = btf_type_by_id(btf, t->type);
        }

--
2.30.2

Re: [PATCH] bpf: remove redundant assignment of variable id

From: Dan Carpenter <hidden>
Date: 2021-03-29 05:57:09

On Fri, Mar 26, 2021 at 01:18:36PM -0700, Song Liu wrote:
On Fri, Mar 26, 2021 at 12:45 PM Colin King [off-list ref] wrote:
quoted
From: Colin Ian King <redacted>

The variable id is being assigned a value that is never
read, the assignment is redundant and can be removed.

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

For future patches, please prefix it as [PATCH bpf-next] for
[PATCH bpf], based on which tree the patch should apply to.
You can keep asking us to do that but it's never going to happen... :P
I do this for networking but it's a massive pain in the butt and I get
it wrong 20% of the time.

regards,
dan carpenter

Re: [PATCH] bpf: remove redundant assignment of variable id

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-03-30 21:11:00

Hello:

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

On Fri, 26 Mar 2021 19:43:48 +0000 you wrote:
From: Colin Ian King <redacted>

The variable id is being assigned a value that is never
read, 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 assignment of variable id
    https://git.kernel.org/bpf/bpf-next/c/235fc0e36d35

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