From 72afd877b54b0ceb24944d573ddfe676d8adc5ae Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Tue, 8 Aug 2023 09:25:37 -0400 Subject: [PATCH] integration-test: clang-format C files --- test/integration-test/bpf/ext.bpf.c | 7 ++-- test/integration-test/bpf/main.bpf.c | 7 ++-- test/integration-test/bpf/multimap-btf.bpf.c | 34 ++++++++++---------- test/integration-test/bpf/text_64_64_reloc.c | 29 ++++++++--------- 4 files changed, 36 insertions(+), 41 deletions(-) diff --git a/test/integration-test/bpf/ext.bpf.c b/test/integration-test/bpf/ext.bpf.c index dc82f5cf..6ec95229 100644 --- a/test/integration-test/bpf/ext.bpf.c +++ b/test/integration-test/bpf/ext.bpf.c @@ -1,10 +1,9 @@ +// clang-format off #include #include +// clang-format on SEC("xdp") -int xdp_drop(struct xdp_md *ctx) -{ - return XDP_DROP; -} +int xdp_drop(struct xdp_md *ctx) { return XDP_DROP; } char _license[] SEC("license") = "GPL"; diff --git a/test/integration-test/bpf/main.bpf.c b/test/integration-test/bpf/main.bpf.c index 2a30577f..f60e42a9 100644 --- a/test/integration-test/bpf/main.bpf.c +++ b/test/integration-test/bpf/main.bpf.c @@ -1,10 +1,9 @@ +// clang-format off #include #include +// clang-format on SEC("xdp") -int xdp_pass(struct xdp_md *ctx) -{ - return XDP_PASS; -} +int xdp_pass(struct xdp_md *ctx) { return XDP_PASS; } char _license[] SEC("license") = "GPL"; diff --git a/test/integration-test/bpf/multimap-btf.bpf.c b/test/integration-test/bpf/multimap-btf.bpf.c index 955a91d3..07fcc60f 100644 --- a/test/integration-test/bpf/multimap-btf.bpf.c +++ b/test/integration-test/bpf/multimap-btf.bpf.c @@ -1,30 +1,30 @@ +// clang-format off #include #include +// clang-format on struct { - __uint(type, BPF_MAP_TYPE_ARRAY); - __type(key, __u32); - __type(value, __u64); - __uint(max_entries, 1); + __uint(type, BPF_MAP_TYPE_ARRAY); + __type(key, __u32); + __type(value, __u64); + __uint(max_entries, 1); } map_1 SEC(".maps"); struct { - __uint(type, BPF_MAP_TYPE_ARRAY); - __type(key, __u32); - __type(value, __u64); - __uint(max_entries, 1); + __uint(type, BPF_MAP_TYPE_ARRAY); + __type(key, __u32); + __type(value, __u64); + __uint(max_entries, 1); } map_2 SEC(".maps"); - SEC("tracepoint") -int bpf_prog(void *ctx) -{ - __u32 key = 0; - __u64 twenty_four = 24; - __u64 forty_two = 42; - bpf_map_update_elem(&map_1, &key, &twenty_four, BPF_ANY); - bpf_map_update_elem(&map_2, &key, &forty_two, BPF_ANY); - return 0; +int bpf_prog(void *ctx) { + __u32 key = 0; + __u64 twenty_four = 24; + __u64 forty_two = 42; + bpf_map_update_elem(&map_1, &key, &twenty_four, BPF_ANY); + bpf_map_update_elem(&map_2, &key, &forty_two, BPF_ANY); + return 0; } char _license[] SEC("license") = "GPL"; diff --git a/test/integration-test/bpf/text_64_64_reloc.c b/test/integration-test/bpf/text_64_64_reloc.c index 877c7628..cd273a35 100644 --- a/test/integration-test/bpf/text_64_64_reloc.c +++ b/test/integration-test/bpf/text_64_64_reloc.c @@ -1,28 +1,25 @@ +// clang-format off #include #include +// clang-format on char _license[] SEC("license") = "GPL"; struct { - __uint(type, BPF_MAP_TYPE_ARRAY); - __type(key, __u32); - __type(value, __u64); - __uint(max_entries, 2); + __uint(type, BPF_MAP_TYPE_ARRAY); + __type(key, __u32); + __type(value, __u64); + __uint(max_entries, 2); } RESULTS SEC(".maps"); -static __u64 -inc_cb(void *map, __u32 *key, void *val, - void *data) -{ - __u64 *value = val; - *value += 1; - return 0; +static __u64 inc_cb(void *map, __u32 *key, void *val, void *data) { + __u64 *value = val; + *value += 1; + return 0; } SEC("uprobe/test_text_64_64_reloc") -int test_text_64_64_reloc(struct pt_regs *ctx) -{ - bpf_for_each_map_elem(&RESULTS, inc_cb, NULL, 0); - return 0; +int test_text_64_64_reloc(struct pt_regs *ctx) { + bpf_for_each_map_elem(&RESULTS, inc_cb, NULL, 0); + return 0; } -