xref: /linux/tools/testing/selftests/bpf/progs/test_global_func17.c (revision 498e2f7a6e69dcbca24715de2b4b97569fdfeff4)
1 // SPDX-License-Identifier: GPL-2.0-only
2 #include <vmlinux.h>
3 #include <bpf/bpf_helpers.h>
4 
5 __noinline int foo(int *p)
6 {
7 	return p ? (*p = 42) : 0;
8 }
9 
10 const volatile int i;
11 
12 SEC("tc")
13 int test_cls(struct __sk_buff *skb)
14 {
15 	return foo((int *)&i);
16 }
17