aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/progs/test_global_data.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_global_data.c')
-rw-r--r--tools/testing/selftests/bpf/progs/test_global_data.c37
1 files changed, 14 insertions, 23 deletions
diff --git a/tools/testing/selftests/bpf/progs/test_global_data.c b/tools/testing/selftests/bpf/progs/test_global_data.c
index 866cc7ddbe43..32a6073acb99 100644
--- a/tools/testing/selftests/bpf/progs/test_global_data.c
+++ b/tools/testing/selftests/bpf/progs/test_global_data.c
@@ -8,24 +8,18 @@
#include "bpf_helpers.h"
struct {
- __u32 type;
- __u32 max_entries;
- __u32 *key;
- __u64 *value;
-} result_number SEC(".maps") = {
- .type = BPF_MAP_TYPE_ARRAY,
- .max_entries = 11,
-};
+ __uint(type, BPF_MAP_TYPE_ARRAY);
+ __uint(max_entries, 11);
+ __type(key, __u32);
+ __type(value, __u64);
+} result_number SEC(".maps");
struct {
- __u32 type;
- __u32 max_entries;
- __u32 *key;
+ __uint(type, BPF_MAP_TYPE_ARRAY);
+ __uint(max_entries, 5);
+ __type(key, __u32);
const char (*value)[32];
-} result_string SEC(".maps") = {
- .type = BPF_MAP_TYPE_ARRAY,
- .max_entries = 5,
-};
+} result_string SEC(".maps");
struct foo {
__u8 a;
@@ -34,14 +28,11 @@ struct foo {
};
struct {
- __u32 type;
- __u32 max_entries;
- __u32 *key;
- struct foo *value;
-} result_struct SEC(".maps") = {
- .type = BPF_MAP_TYPE_ARRAY,
- .max_entries = 5,
-};
+ __uint(type, BPF_MAP_TYPE_ARRAY);
+ __uint(max_entries, 5);
+ __type(key, __u32);
+ __type(value, struct foo);
+} result_struct SEC(".maps");
/* Relocation tests for __u64s. */
static __u64 num0;