bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next] bpftool: Don't try to return value from void function in skeleton
@ 2022-07-26 13:32 Jörn-Thorben Hinz
  2022-07-27 21:00 ` Quentin Monnet
  2022-07-29 17:50 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Jörn-Thorben Hinz @ 2022-07-26 13:32 UTC (permalink / raw)
  To: bpf
  Cc: Jörn-Thorben Hinz, Quentin Monnet, Alexei Starovoitov,
	Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau, Song Liu,
	Yonghong Song, John Fastabend, KP Singh, Stanislav Fomichev,
	Hao Luo, Jiri Olsa

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>
---
 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 1cf53bb01936..7070dcffa822 100644
--- a/tools/bpf/bpftool/gen.c
+++ b/tools/bpf/bpftool/gen.c
@@ -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
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf-next] bpftool: Don't try to return value from void function in skeleton
  2022-07-26 13:32 [PATCH bpf-next] bpftool: Don't try to return value from void function in skeleton Jörn-Thorben Hinz
@ 2022-07-27 21:00 ` Quentin Monnet
  2022-07-29 17:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Quentin Monnet @ 2022-07-27 21:00 UTC (permalink / raw)
  To: Jörn-Thorben Hinz
  Cc: bpf, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa

On Tue, 26 Jul 2022 at 14:32, Jörn-Thorben Hinz
<jthinz@mailbox.tu-berlin.de> wrote:
>
> 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>

Reviewed-by: Quentin Monnet <quentin@isovalent.com>

Thank you!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf-next] bpftool: Don't try to return value from void function in skeleton
  2022-07-26 13:32 [PATCH bpf-next] bpftool: Don't try to return value from void function in skeleton Jörn-Thorben Hinz
  2022-07-27 21:00 ` Quentin Monnet
@ 2022-07-29 17:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-07-29 17:50 UTC (permalink / raw)
  To: =?utf-8?q?J=C3=B6rn-Thorben_Hinz_=3Cjthinz=40mailbox=2Etu-berlin=2Ede=3E?=
  Cc: bpf, quentin, ast, daniel, andrii, martin.lau, song, yhs,
	john.fastabend, kpsingh, sdf, haoluo, jolsa

Hello:

This patch was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <andrii@kernel.org>:

On Tue, 26 Jul 2022 15:32:03 +0200 you wrote:
> 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>
> 
> [...]

Here is the summary with links:
  - [bpf-next] bpftool: Don't try to return value from void function in skeleton
    https://git.kernel.org/bpf/bpf-next/c/a6df06744b2d

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-29 17:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-26 13:32 [PATCH bpf-next] bpftool: Don't try to return value from void function in skeleton Jörn-Thorben Hinz
2022-07-27 21:00 ` Quentin Monnet
2022-07-29 17:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).