Skip to contentSkip to conversation

selftests/bpf: fix compiler warning in BPF_KPROBE definition in loop6.c

PATCH In review Andrii Nakryiko 2 participants 2 messages Mar 9, 2021

Subsystems (5)
lore
Share & tools
lore

Andrii Nakryiko

author maintainer
#0 lore raw

PATCH 1/1 selftests/bpf: fix compiler warning in BPF_KPROBE definition in loop6.c

Add missing return type to BPF_KPROBE definition. Without it, compiler generates the following warning:

progs/loop6.c:68:12: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] BPF_KPROBE(trace_virtqueue_add_sgs, void *unused, struct scatterlist **sgs,

           ^

1 warning generated.

Fixes 86a35af628e5 ("selftests/bpf: Add a verifier scale test with unknown bounded loop")
---
 tools/testing/selftests/bpf/progs/loop6.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/bpf/progs/loop6.c +2 -2
index 2a7141ac1656..38de0331e6b4 100644
@@ -65,8 +65,8 @@ int config = 0;
 int result = 0;
 
 SEC("kprobe/virtqueue_add_sgs")
-BPF_KPROBE(trace_virtqueue_add_sgs, void *unused, struct scatterlist **sgs,
-	   unsigned int out_sgs, unsigned int in_sgs)
+int BPF_KPROBE(trace_virtqueue_add_sgs, void *unused, struct scatterlist **sgs,
+	       unsigned int out_sgs, unsigned int in_sgs)
 {
 	struct scatterlist *sgp = NULL;
 	__u64 length1 = 0, length2 = 0;
Signature · 1 line
2.24.1
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Andrii Nakryiko

Add missing return type to BPF_KPROBE definition. Without it, compiler generates the following warning:

progs/loop6.c:68:12: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] BPF_KPROBE(trace_virtqueue_add_sgs, void *unused, struct scatterlist **sgs,

            ^

1 warning generated.

Fixes 86a35af628e5 ("selftests/bpf: Add a verifier scale test with unknown bounded loop")

Oh, my bad. Thanks for fixing it!