bpftool: Don't try to return value from void function in skeleton
authorJörn-Thorben Hinz <jthinz@mailbox.tu-berlin.de>
Tue, 26 Jul 2022 13:32:03 +0000 (15:32 +0200)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 29 Jul 2022 17:43:14 +0000 (10:43 -0700)
A skeleton generated by bpftool previously contained a return followed
by an expression in OBJ_NAME__detach(), which has return type void. This
did not hurt, the bpf_object__detach_skeleton() called there returns
void itself anyway, but led to a warning when compiling with e.g.
-pedantic.

Signed-off-by: Jörn-Thorben Hinz <jthinz@mailbox.tu-berlin.de>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Quentin Monnet <quentin@isovalent.com>
Link: https://lore.kernel.org/bpf/20220726133203.514087-1-jthinz@mailbox.tu-berlin.de
tools/bpf/bpftool/gen.c

index 1cf53bb..7070dcf 100644 (file)
@@ -1175,7 +1175,7 @@ static int do_skeleton(int argc, char **argv)
                static inline void                                          \n\
                %1$s__detach(struct %1$s *obj)                              \n\
                {                                                           \n\
-                       return bpf_object__detach_skeleton(obj->skeleton);  \n\
+                       bpf_object__detach_skeleton(obj->skeleton);         \n\
                }                                                           \n\
                ",
                obj_name