[PATCH v1] selftests:bpf:Fix repeated initialization

From: Wang Ming
Date: Wed Jul 05 2023 - 08:35:39 EST


In use_missing_map function, value is
initialized twice.There is no
connection between the two assignment.
This patch could fix this bug.

Signed-off-by: Wang Ming <machel@xxxxxxxx>
---
tools/testing/selftests/bpf/progs/test_log_fixup.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/tools/testing/selftests/bpf/progs/test_log_fixup.c b/tools/testing/selftests/bpf/progs/test_log_fixup.c
index 1bd48feaaa42..1c49b2f9be6c 100644
--- a/tools/testing/selftests/bpf/progs/test_log_fixup.c
+++ b/tools/testing/selftests/bpf/progs/test_log_fixup.c
@@ -52,13 +52,9 @@ struct {
SEC("?raw_tp/sys_enter")
int use_missing_map(const void *ctx)
{
- int zero = 0, *value;
+ int zero = 0;

- value = bpf_map_lookup_elem(&existing_map, &zero);
-
- value = bpf_map_lookup_elem(&missing_map, &zero);
-
- return value != NULL;
+ return bpf_map_lookup_elem(&missing_map, &zero) != NULL;
}

extern int bpf_nonexistent_kfunc(void) __ksym __weak;
--
2.25.1