diff mbox series

bpf: remove redundant assignment to pointer t

Message ID 20211207224718.59593-1-colin.i.king@gmail.com (mailing list archive)
State Accepted
Commit 73b6eae583f44e278e19489a411f9c1e22d530fc
Delegated to: BPF
Headers show
Series bpf: remove redundant assignment to pointer t | expand

Checks

Context Check Description
bpf/vmtest-bpf-next-PR fail PR summary
bpf/vmtest-bpf-next fail VM_Test
bpf/vmtest-bpf-PR pending PR summary
bpf/vmtest-bpf pending VM_Test
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

Colin Ian King Dec. 7, 2021, 10:47 p.m. UTC
The pointer t is being initialized with a value that is never read. The
pointer is re-assigned a value a littler later on, hence the initialization
is redundant and can be removed.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 kernel/bpf/btf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

patchwork-bot+netdevbpf@kernel.org Dec. 9, 2021, 7:20 a.m. UTC | #1
Hello:

This patch was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <andrii@kernel.org>:

On Tue,  7 Dec 2021 22:47:18 +0000 you wrote:
> The pointer t is being initialized with a value that is never read. The
> pointer is re-assigned a value a littler later on, hence the initialization
> is redundant and can be removed.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
>  kernel/bpf/btf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - bpf: remove redundant assignment to pointer t
    https://git.kernel.org/bpf/bpf-next/c/73b6eae583f4

You are awesome, thank you!
diff mbox series

Patch

diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
index 48cdf5b425a7..c70f80055b8e 100644
--- a/kernel/bpf/btf.c
+++ b/kernel/bpf/btf.c
@@ -836,7 +836,7 @@  static const char *btf_show_name(struct btf_show *show)
 	const char *ptr_suffix = &ptr_suffixes[strlen(ptr_suffixes)];
 	const char *name = NULL, *prefix = "", *parens = "";
 	const struct btf_member *m = show->state.member;
-	const struct btf_type *t = show->state.type;
+	const struct btf_type *t;
 	const struct btf_array *array;
 	u32 id = show->state.type_id;
 	const char *member = NULL;