diff options
| author | Andrii Nakryiko <[email protected]> | 2023-10-06 17:57:42 +0000 |
|---|---|---|
| committer | Daniel Borkmann <[email protected]> | 2023-10-06 18:17:28 +0000 |
| commit | 925a01577ea5a70416731c00e42b74c97f41cb6a (patch) | |
| tree | 39947655872d56199dd9a3d986b84b02aa0b38dc /tools/testing/selftests/bpf/prog_tests/sockmap_basic.c | |
| parent | bpf: Inherit system settings for CPU security mitigations (diff) | |
| download | kernel-925a01577ea5a70416731c00e42b74c97f41cb6a.tar.gz kernel-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 <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Acked-by: Jiri Olsa <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/sockmap_basic.c')
| -rw-r--r-- | tools/testing/selftests/bpf/prog_tests/sockmap_basic.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c b/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c index 064cc5e8d9ad..2535d0653cc8 100644 --- a/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c +++ b/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c @@ -359,7 +359,7 @@ out: static void test_sockmap_skb_verdict_shutdown(void) { struct epoll_event ev, events[MAX_EVENTS]; - int n, err, map, verdict, s, c1, p1; + int n, err, map, verdict, s, c1 = -1, p1 = -1; struct test_sockmap_pass_prog *skel; int epollfd; int zero = 0; @@ -414,9 +414,9 @@ out: static void test_sockmap_skb_verdict_fionread(bool pass_prog) { int expected, zero = 0, sent, recvd, avail; - int err, map, verdict, s, c0, c1, p0, p1; - struct test_sockmap_pass_prog *pass; - struct test_sockmap_drop_prog *drop; + int err, map, verdict, s, c0 = -1, c1 = -1, p0 = -1, p1 = -1; + struct test_sockmap_pass_prog *pass = NULL; + struct test_sockmap_drop_prog *drop = NULL; char buf[256] = "0123456789"; if (pass_prog) { |
