Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/bpf: Move ENOTSUPP from bpf_util.h

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>

authored by

Hou Tao and committed by
Andrii Nakryiko
503cfb10 b9e9ed90

+3 -20
+3
tools/testing/selftests/bpf/bpf_util.h
··· 67 67 #define sys_gettid() syscall(SYS_gettid) 68 68 #endif 69 69 70 + #ifndef ENOTSUPP 71 + #define ENOTSUPP 524 72 + #endif 70 73 71 74 #endif /* __BPF_UTIL__ */
-4
tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c
··· 16 16 #include "tcp_ca_kfunc.skel.h" 17 17 #include "bpf_cc_cubic.skel.h" 18 18 19 - #ifndef ENOTSUPP 20 - #define ENOTSUPP 524 21 - #endif 22 - 23 19 static const unsigned int total_bytes = 10 * 1024 * 1024; 24 20 static int expected_stg = 0xeB9F; 25 21
-4
tools/testing/selftests/bpf/prog_tests/lsm_cgroup.c
··· 10 10 #include "cgroup_helpers.h" 11 11 #include "network_helpers.h" 12 12 13 - #ifndef ENOTSUPP 14 - #define ENOTSUPP 524 15 - #endif 16 - 17 13 static struct btf *btf; 18 14 19 15 static __u32 query_prog_cnt(int cgroup_fd, const char *attach_func)
-4
tools/testing/selftests/bpf/prog_tests/sock_addr.c
··· 23 23 #include "getpeername_unix_prog.skel.h" 24 24 #include "network_helpers.h" 25 25 26 - #ifndef ENOTSUPP 27 - # define ENOTSUPP 524 28 - #endif 29 - 30 26 #define TEST_NS "sock_addr" 31 27 #define TEST_IF_PREFIX "test_sock_addr" 32 28 #define TEST_IPV4 "127.0.0.4"
-4
tools/testing/selftests/bpf/test_maps.c
··· 26 26 #include "test_maps.h" 27 27 #include "testing_helpers.h" 28 28 29 - #ifndef ENOTSUPP 30 - #define ENOTSUPP 524 31 - #endif 32 - 33 29 int skips; 34 30 35 31 static struct bpf_map_create_opts map_opts = { .sz = sizeof(map_opts) };
-4
tools/testing/selftests/bpf/test_verifier.c
··· 42 42 #include "../../../include/linux/filter.h" 43 43 #include "testing_helpers.h" 44 44 45 - #ifndef ENOTSUPP 46 - #define ENOTSUPP 524 47 - #endif 48 - 49 45 #define MAX_INSNS BPF_MAXINSNS 50 46 #define MAX_EXPECTED_INSNS 32 51 47 #define MAX_UNEXPECTED_INSNS 32