Skip to contentSkip to conversation

selftests/bpf: fix compiler warnings in bpf_testmod for kfuncs

PATCH Applied Andrii Nakryiko 2 participants 2 messages Apr 12, 2023 – Apr 13, 2023

Subsystems (4)
lore
Share & tools
lore

Andrii Nakryiko

author maintainer
#0 lore raw

PATCH 1/1 selftests/bpf: fix compiler warnings in bpf_testmod for kfuncs

Add -Wmissing-prototypes ignore in bpf_testmod.c, similarly to what we do in kernel code proper.

---
 tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c | 6 ++++++
 1 file changed, 6 insertions(+)
tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c +6 -0
index 7999476b9446..dd35659ab9ae 100644
@@ -28,6 +28,10 @@ struct bpf_testmod_struct_arg_2 {
 	long b;
 };
 
+__diag_push();
+__diag_ignore_all("-Wmissing-prototypes",
+		  "Global functions as their definitions will be in bpf_testmod.ko BTF");
+
 noinline int
 bpf_testmod_test_struct_arg_1(struct bpf_testmod_struct_arg_2 a, int b, int c) {
 	bpf_testmod_test_struct_arg_result = a.a + a.b  + b + c;
@@ -171,6 +175,8 @@ noinline int bpf_testmod_fentry_test3(char a, int b, u64 c)
 	return a + b + c;
 }
 
+__diag_pop();
+
 int bpf_testmod_fentry_ok;
 
 noinline ssize_t
Signature · 1 line
2.34.1
#1 lore raw
This patch was applied to bpf/bpf-next.git (master) by Daniel Borkmann <[email protected]>:

Hello:

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

Quoted 8 lines · On Tue, 11 Apr 2023 20:46:47 -0700 you wrote:

Add -Wmissing-prototypes ignore in bpf_testmod.c, similarly to what we do in kernel code proper.

[...]

Here is the summary with links:
- [bpf-next] selftests/bpf: fix compiler warnings in bpf_testmod for kfuncs

    https://git.kernel.org/bpf/bpf-next/c/4099be372faf

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html