summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/prog_tests/sockmap_helpers.h
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2023-10-06 10:57:42 -0700
committerDaniel Borkmann <daniel@iogearbox.net>2023-10-06 20:17:28 +0200
commit925a01577ea5a70416731c00e42b74c97f41cb6a (patch)
tree39947655872d56199dd9a3d986b84b02aa0b38dc /tools/testing/selftests/bpf/prog_tests/sockmap_helpers.h
parentbc5bc309db45a7ab218ce8259ba9bc7659be61ca (diff)
downloadlinux-925a01577ea5a70416731c00e42b74c97f41cb6a.tar.gz
linux-925a01577ea5a70416731c00e42b74c97f41cb6a.tar.bz2
linux-925a01577ea5a70416731c00e42b74c97f41cb6a.zip
selftests/bpf: Fix compiler warnings reported in -O2 mode
Fix a bunch of potentially unitialized variable usage warnings that are reported by GCC in -O2 mode. Also silence overzealous stringop-truncation class of warnings. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Jiri Olsa <jolsa@kernel.org> Link: https://lore.kernel.org/bpf/20231006175744.3136675-1-andrii@kernel.org
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/sockmap_helpers.h')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/sockmap_helpers.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_helpers.h b/tools/testing/selftests/bpf/prog_tests/sockmap_helpers.h
index 36d829a65aa4..e880f97bc44d 100644
--- a/tools/testing/selftests/bpf/prog_tests/sockmap_helpers.h
+++ b/tools/testing/selftests/bpf/prog_tests/sockmap_helpers.h
@@ -378,7 +378,7 @@ static inline int enable_reuseport(int s, int progfd)
static inline int socket_loopback_reuseport(int family, int sotype, int progfd)
{
struct sockaddr_storage addr;
- socklen_t len;
+ socklen_t len = 0;
int err, s;
init_addr_loopback(family, &addr, &len);