]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
selftests/bpf: Move ENOTSUPP from bpf_util.h
authorHou Tao <houtao1@huawei.com>
Wed, 6 Nov 2024 06:35:41 +0000 (14:35 +0800)
committerAndrii Nakryiko <andrii@kernel.org>
Mon, 11 Nov 2024 16:18:35 +0000 (08:18 -0800)
Moving the definition of ENOTSUPP into bpf_util.h to remove the
duplicated definitions in multiple files.

Signed-off-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20241106063542.357743-3-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
tools/testing/selftests/bpf/bpf_util.h
tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c
tools/testing/selftests/bpf/prog_tests/lsm_cgroup.c
tools/testing/selftests/bpf/prog_tests/sock_addr.c
tools/testing/selftests/bpf/test_maps.c
tools/testing/selftests/bpf/test_verifier.c

index feff92219e213f3694d7570a7c8e9dd6cd409bf9..5f6963a320d73252a437ffca6da56403642e2d61 100644 (file)
@@ -67,5 +67,8 @@ static inline void bpf_strlcpy(char *dst, const char *src, size_t sz)
 #define sys_gettid() syscall(SYS_gettid)
 #endif
 
+#ifndef ENOTSUPP
+#define ENOTSUPP 524
+#endif
 
 #endif /* __BPF_UTIL__ */
index 409a069758230fd42ad6d010aa3ff6df30e946ad..b7d1b52309d0f0ba8e42d28de1eaabcb9374b76e 100644 (file)
 #include "tcp_ca_kfunc.skel.h"
 #include "bpf_cc_cubic.skel.h"
 
-#ifndef ENOTSUPP
-#define ENOTSUPP 524
-#endif
-
 static const unsigned int total_bytes = 10 * 1024 * 1024;
 static int expected_stg = 0xeB9F;
 
index 130a3b21e467f84b7518d11d7a32e8e4a5236eca..6df25de8f080a0cbf1d699618fa0424605b45ae4 100644 (file)
 #include "cgroup_helpers.h"
 #include "network_helpers.h"
 
-#ifndef ENOTSUPP
-#define ENOTSUPP 524
-#endif
-
 static struct btf *btf;
 
 static __u32 query_prog_cnt(int cgroup_fd, const char *attach_func)
index a6ee7f8d4f7915aa5f904517f23cb15254621286..b2efabbed220c22629d6fb555c35465067103268 100644 (file)
 #include "getpeername_unix_prog.skel.h"
 #include "network_helpers.h"
 
-#ifndef ENOTSUPP
-# define ENOTSUPP 524
-#endif
-
 #define TEST_NS                 "sock_addr"
 #define TEST_IF_PREFIX          "test_sock_addr"
 #define TEST_IPV4               "127.0.0.4"
index 905d5981ace1b4713abaf37583dd3175d76bd630..8b40e9496af16868120c9c2dae0662f44a8c59a1 100644 (file)
 #include "test_maps.h"
 #include "testing_helpers.h"
 
-#ifndef ENOTSUPP
-#define ENOTSUPP 524
-#endif
-
 int skips;
 
 static struct bpf_map_create_opts map_opts = { .sz = sizeof(map_opts) };
index 610392dfc4fbc63178237a4032ddc0cccb12251e..447b68509d7674922086459d1e1d814c212f4511 100644 (file)
 #include "../../../include/linux/filter.h"
 #include "testing_helpers.h"
 
-#ifndef ENOTSUPP
-#define ENOTSUPP 524
-#endif
-
 #define MAX_INSNS      BPF_MAXINSNS
 #define MAX_EXPECTED_INSNS     32
 #define MAX_UNEXPECTED_INSNS   32