Skip to content

Commit 2453ef7

Browse files
tohojokernel-patches-bot
authored andcommitted
selftests: Make sure all 'skel' variables are declared static
If programs in prog_tests using skeletons declare the 'skel' variable as global but not static, that will lead to linker errors on the final link of the prog_tests binary due to duplicate symbols. Fix a few instances of this. Fixes: b18c1f0 ("bpf: selftest: Adapt sock_fields test to use skel and global variables") Fixes: 9a856ca ("bpf: selftest: Add test_btf_skc_cls_ingress") Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
1 parent c015948 commit 2453ef7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "test_progs.h"
1717
#include "test_btf_skc_cls_ingress.skel.h"
1818

19-
struct test_btf_skc_cls_ingress *skel;
19+
static struct test_btf_skc_cls_ingress *skel;
2020
struct sockaddr_in6 srv_sa6;
2121
static __u32 duration;
2222

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct bpf_spinlock_cnt {
3636

3737
static struct sockaddr_in6 srv_sa6, cli_sa6;
3838
static int sk_pkt_out_cnt10_fd;
39-
struct test_sock_fields *skel;
39+
static struct test_sock_fields *skel;
4040
static int sk_pkt_out_cnt_fd;
4141
static __u64 parent_cg_id;
4242
static __u64 child_cg_id;

0 commit comments

Comments
 (0)