On Sat, Apr 23, 2022 at 7:02 AM Yafang Shao <laoar.shao@xxxxxxxxx> wrote: > > There is no return value of bpf_object__detach_skeleton(), so we'd > better not return it, that is formal. > > Fixes: 5dc7a8b21144 ("bpftool, selftests/bpf: Embed object file inside skeleton") > Signed-off-by: Yafang Shao <laoar.shao@xxxxxxxxx> > --- > tools/bpf/bpftool/gen.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/bpf/bpftool/gen.c b/tools/bpf/bpftool/gen.c > index 7678af364793..8f76d8d9996c 100644 > --- a/tools/bpf/bpftool/gen.c > +++ b/tools/bpf/bpftool/gen.c > @@ -1171,7 +1171,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\ It's not incorrect to return the result of void-returning function in another void-returning function. C compiler allows this and we rely on this property very explicitly in macros like BPF_PROG and BPF_KPROBE. So if anything, it's not a fix, at best improvement, but even then quite optional. > } \n\ > ", > obj_name > -- > 2.17.1 >