aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/prog_tests/cgroup_v1v2.c
diff options
context:
space:
mode:
authorGeliang Tang <[email protected]>2024-07-18 06:22:29 +0000
committerAndrii Nakryiko <[email protected]>2024-07-29 19:52:24 +0000
commita63507f3b11de30fd7711ec244fe354fb4a01a09 (patch)
treea23b7388669035267777cf0d6127ff2c7a92965a /tools/testing/selftests/bpf/prog_tests/cgroup_v1v2.c
parentMerge tag 'net-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/net... (diff)
downloadkernel-a63507f3b11de30fd7711ec244fe354fb4a01a09.tar.gz
kernel-a63507f3b11de30fd7711ec244fe354fb4a01a09.zip
selftests/bpf: Drop type of connect_to_fd_opts
The "type" parameter of connect_to_fd_opts() is redundant of "server_fd". Since the "type" can be obtained inside by invoking getsockopt(SO_TYPE), without passing it in as a parameter. This patch drops the "type" parameter of connect_to_fd_opts() and updates its callers. Suggested-by: Martin KaFai Lau <[email protected]> Signed-off-by: Geliang Tang <[email protected]> Link: https://lore.kernel.org/r/50d8ce7ab7ab0c0f4d211fc7cc4ebe3d3f63424c.1721282219.git.tanggeliang@kylinos.cn Signed-off-by: Martin KaFai Lau <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/cgroup_v1v2.c')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/cgroup_v1v2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/cgroup_v1v2.c b/tools/testing/selftests/bpf/prog_tests/cgroup_v1v2.c
index 9709c8db7275..addf720428f7 100644
--- a/tools/testing/selftests/bpf/prog_tests/cgroup_v1v2.c
+++ b/tools/testing/selftests/bpf/prog_tests/cgroup_v1v2.c
@@ -32,7 +32,7 @@ static int run_test(int cgroup_fd, int server_fd, bool classid)
goto out;
}
- fd = connect_to_fd_opts(server_fd, SOCK_STREAM, &opts);
+ fd = connect_to_fd_opts(server_fd, &opts);
if (fd < 0)
err = -1;
else
@@ -52,7 +52,7 @@ void test_cgroup_v1v2(void)
server_fd = start_server(AF_INET, SOCK_STREAM, NULL, port, 0);
if (!ASSERT_GE(server_fd, 0, "server_fd"))
return;
- client_fd = connect_to_fd_opts(server_fd, SOCK_STREAM, &opts);
+ client_fd = connect_to_fd_opts(server_fd, &opts);
if (!ASSERT_GE(client_fd, 0, "client_fd")) {
close(server_fd);
return;