From: Geliang Tang Date: Thu, 23 May 2024 06:49:58 +0000 (+0800) Subject: selftests/bpf: Drop duplicate definition of i in test_sockmap X-Git-Tag: v6.11-rc1~163^2~222^2~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a9f0ea175948c21640ae1cc145e679db7fc45fa6;p=thirdparty%2Fkernel%2Flinux.git selftests/bpf: Drop duplicate definition of i in test_sockmap There's already a definition of i in run_options() at the beginning, no need to define a new one in "if (tx_prog_fd > 0)" block. Signed-off-by: Geliang Tang Signed-off-by: Daniel Borkmann Tested-by: Jakub Sitnicki Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/8d690682330a59361562bca75d6903253d16f312.1716446893.git.tanggeliang@kylinos.cn --- diff --git a/tools/testing/selftests/bpf/test_sockmap.c b/tools/testing/selftests/bpf/test_sockmap.c index 892a690c4e7b4..6d724fea59fbf 100644 --- a/tools/testing/selftests/bpf/test_sockmap.c +++ b/tools/testing/selftests/bpf/test_sockmap.c @@ -1030,7 +1030,7 @@ run: tx_prog_fd = -1; if (tx_prog_fd > 0) { - int redir_fd, i = 0; + int redir_fd; err = bpf_prog_attach(tx_prog_fd, map_fd[1], BPF_SK_MSG_VERDICT, 0); @@ -1041,6 +1041,7 @@ run: goto out; } + i = 0; err = bpf_map_update_elem(map_fd[1], &i, &c1, BPF_ANY); if (err) { fprintf(stderr,