Skip to content

Commit

Permalink
selftests/bpf: Fix two minor compilation warnings reported by GCC 4.9
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Andrii Nakryiko authored and Daniel Borkmann committed Aug 20, 2020
1 parent dda1ec9 commit 37a6a9e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/testing/selftests/bpf/prog_tests/sk_assign.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ void test_sk_assign(void)
int server = -1;
int server_map;
int self_net;
int i;

self_net = open(NS_SELF, O_RDONLY);
if (CHECK_FAIL(self_net < 0)) {
Expand All @@ -286,7 +287,7 @@ void test_sk_assign(void)
goto cleanup;
}

for (int i = 0; i < ARRAY_SIZE(tests) && !READ_ONCE(stop); i++) {
for (i = 0; i < ARRAY_SIZE(tests) && !READ_ONCE(stop); i++) {
struct test_sk_cfg *test = &tests[i];
const struct sockaddr *addr;
const int zero = 0;
Expand Down
1 change: 1 addition & 0 deletions tools/testing/selftests/bpf/test_current_pid_tgid_new_ns.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,5 @@ int main(int argc, char **argv)
bpf_object__close(obj);
}
}
return 0;
}

0 comments on commit 37a6a9e

Please sign in to comment.