2024-06-02 23:41:36

by Dr. David Alan Gilbert

[permalink] [raw]
Subject: [PATCH 0/3] Dead structs in tools/testing/selftests/bpf

From: "Dr. David Alan Gilbert" <[email protected]>

Hi,
Clean out a bunch of old structs in selftests/bpf.
I've been using a 'make test_progs' as a build test.

Signed-off-by: Dr. David Alan Gilbert <[email protected]>


Dr. David Alan Gilbert (3):
selftests/bpf: remove unused struct 'scale_test_def'
selftests/bpf: remove unused 'key_t' structs
selftests/bpf: remove unused struct 'libcap'

tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c | 6 ------
tools/testing/selftests/bpf/progs/bpf_iter_bpf_array_map.c | 6 ------
.../selftests/bpf/progs/bpf_iter_bpf_percpu_array_map.c | 6 ------
tools/testing/selftests/bpf/test_verifier.c | 5 -----
4 files changed, 23 deletions(-)

--
2.45.1



2024-06-02 23:41:50

by Dr. David Alan Gilbert

[permalink] [raw]
Subject: [PATCH 1/3] selftests/bpf: remove unused struct 'scale_test_def'

From: "Dr. David Alan Gilbert" <[email protected]>

'scale_test_def' is unused since
commit 3762a39ce85f ("selftests/bpf: Split out bpf_verif_scale selftests
into multiple tests").

Remove it.

Signed-off-by: Dr. David Alan Gilbert <[email protected]>
---
tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c | 6 ------
1 file changed, 6 deletions(-)

diff --git a/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c b/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c
index 4c6ada5b270b..73f669014b69 100644
--- a/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c
+++ b/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c
@@ -45,12 +45,6 @@ static int check_load(const char *file, enum bpf_prog_type type)
return err;
}

-struct scale_test_def {
- const char *file;
- enum bpf_prog_type attach_type;
- bool fails;
-};
-
static void scale_test(const char *file,
enum bpf_prog_type attach_type,
bool should_fail)
--
2.45.1


2024-06-02 23:42:03

by Dr. David Alan Gilbert

[permalink] [raw]
Subject: [PATCH 2/3] selftests/bpf: remove unused 'key_t' structs

From: "Dr. David Alan Gilbert" <[email protected]>

'key_t' is unused in a couple of files since the original
commit 60dd49ea6539 ("selftests/bpf: Add test for bpf array map
iterators").

Remove it.

Signed-off-by: Dr. David Alan Gilbert <[email protected]>
---
tools/testing/selftests/bpf/progs/bpf_iter_bpf_array_map.c | 6 ------
.../selftests/bpf/progs/bpf_iter_bpf_percpu_array_map.c | 6 ------
2 files changed, 12 deletions(-)

diff --git a/tools/testing/selftests/bpf/progs/bpf_iter_bpf_array_map.c b/tools/testing/selftests/bpf/progs/bpf_iter_bpf_array_map.c
index c5969ca6f26b..564835ba7d51 100644
--- a/tools/testing/selftests/bpf/progs/bpf_iter_bpf_array_map.c
+++ b/tools/testing/selftests/bpf/progs/bpf_iter_bpf_array_map.c
@@ -6,12 +6,6 @@

char _license[] SEC("license") = "GPL";

-struct key_t {
- int a;
- int b;
- int c;
-};
-
struct {
__uint(type, BPF_MAP_TYPE_ARRAY);
__uint(max_entries, 3);
diff --git a/tools/testing/selftests/bpf/progs/bpf_iter_bpf_percpu_array_map.c b/tools/testing/selftests/bpf/progs/bpf_iter_bpf_percpu_array_map.c
index 85fa710fad90..9f0e0705b2bf 100644
--- a/tools/testing/selftests/bpf/progs/bpf_iter_bpf_percpu_array_map.c
+++ b/tools/testing/selftests/bpf/progs/bpf_iter_bpf_percpu_array_map.c
@@ -6,12 +6,6 @@

char _license[] SEC("license") = "GPL";

-struct key_t {
- int a;
- int b;
- int c;
-};
-
struct {
__uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
__uint(max_entries, 3);
--
2.45.1


2024-06-02 23:42:17

by Dr. David Alan Gilbert

[permalink] [raw]
Subject: [PATCH 3/3] selftests/bpf: remove unused struct 'libcap'

From: "Dr. David Alan Gilbert" <[email protected]>

'libcap' is unused since
commit b1c2768a82b9 ("bpf: selftests: Remove libcap usage from
test_verifier").

Remove it.

Signed-off-by: Dr. David Alan Gilbert <[email protected]>
---
tools/testing/selftests/bpf/test_verifier.c | 5 -----
1 file changed, 5 deletions(-)

diff --git a/tools/testing/selftests/bpf/test_verifier.c b/tools/testing/selftests/bpf/test_verifier.c
index df04bda1c927..610392dfc4fb 100644
--- a/tools/testing/selftests/bpf/test_verifier.c
+++ b/tools/testing/selftests/bpf/test_verifier.c
@@ -1237,11 +1237,6 @@ static void do_test_fixup(struct bpf_test *test, enum bpf_prog_type prog_type,
fixup_prog_kfuncs(prog, fd_array, test->fixup_kfunc_btf_id);
}

-struct libcap {
- struct __user_cap_header_struct hdr;
- struct __user_cap_data_struct data[2];
-};
-
static int set_admin(bool admin)
{
int err;
--
2.45.1


2024-06-03 15:10:00

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH 0/3] Dead structs in tools/testing/selftests/bpf

Hello:

This series was applied to bpf/bpf-next.git (master)
by Daniel Borkmann <[email protected]>:

On Mon, 3 Jun 2024 00:41:09 +0100 you wrote:
> From: "Dr. David Alan Gilbert" <[email protected]>
>
> Hi,
> Clean out a bunch of old structs in selftests/bpf.
> I've been using a 'make test_progs' as a build test.
>
> Signed-off-by: Dr. David Alan Gilbert <[email protected]>
>
> [...]

Here is the summary with links:
- [1/3] selftests/bpf: remove unused struct 'scale_test_def'
https://git.kernel.org/bpf/bpf-next/c/dfa7c9ffa607
- [2/3] selftests/bpf: remove unused 'key_t' structs
https://git.kernel.org/bpf/bpf-next/c/3f67639d8e58
- [3/3] selftests/bpf: remove unused struct 'libcap'
https://git.kernel.org/bpf/bpf-next/c/a450d36b05fa

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html