Skip to content

Commit 37a6a9e

Browse files
anakryikoborkmann
authored andcommitted
selftests/bpf: Fix two minor compilation warnings reported by GCC 4.9
GCC 4.9 seems to be more strict in some regards. Fix two minor issue it reported. Fixes: 1c1052e ("tools/testing/selftests/bpf: Add self-tests for new helper bpf_get_ns_current_pid_tgid.") Fixes: 2d7824f ("selftests: bpf: Add test for sk_assign") Signed-off-by: Andrii Nakryiko <andriin@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Yonghong Song <yhs@fb.com> Link: https://lore.kernel.org/bpf/20200820061411.1755905-3-andriin@fb.com
1 parent dda1ec9 commit 37a6a9e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

tools/testing/selftests/bpf/prog_tests/sk_assign.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ void test_sk_assign(void)
268268
int server = -1;
269269
int server_map;
270270
int self_net;
271+
int i;
271272

272273
self_net = open(NS_SELF, O_RDONLY);
273274
if (CHECK_FAIL(self_net < 0)) {
@@ -286,7 +287,7 @@ void test_sk_assign(void)
286287
goto cleanup;
287288
}
288289

289-
for (int i = 0; i < ARRAY_SIZE(tests) && !READ_ONCE(stop); i++) {
290+
for (i = 0; i < ARRAY_SIZE(tests) && !READ_ONCE(stop); i++) {
290291
struct test_sk_cfg *test = &tests[i];
291292
const struct sockaddr *addr;
292293
const int zero = 0;

tools/testing/selftests/bpf/test_current_pid_tgid_new_ns.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,5 @@ int main(int argc, char **argv)
156156
bpf_object__close(obj);
157157
}
158158
}
159+
return 0;
159160
}

0 commit comments

Comments
 (0)