tools/bpftool: Avoid using "?:" in generated code
PATCH 1/1 tools/bpftool: Avoid using "?:" in generated code
"?:" is a GNU C extension, some environment has warning flags for its use, or even prohibit it directly. This patch avoid triggering these problems by simply expand it to its full form, no functionality change.
Signed-off-by Yucong Sun <[email protected]>
--- tools/bpf/bpftool/gen.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
tools/bpf/bpftool/gen.c +4 -1
@@ -803,7 +803,10 @@ static int do_skeleton(int argc, char **argv) } \n\ \n\ err = %1$s__create_skeleton(obj); \n\ - err = err ?: bpf_object__open_skeleton(obj->skeleton, opts);\n\ + if (err) \n\ + goto err_out; \n\ + \n\ + err = bpf_object__open_skeleton(obj->skeleton, opts);\n\ if (err) \n\ goto err_out; \n\ \n\
Signature · 1 line
2.30.2
This patch was applied to bpf/bpf-next.git (refs/heads/master):
Hello:
This patch was applied to bpf/bpf-next.git (refs/heads/master):
Quoted 8 lines · On Tue, 28 Sep 2021 11:42:21 -0700 you wrote:
"?:" is a GNU C extension, some environment has warning flags for its use, or even prohibit it directly. This patch avoid triggering these problems by simply expand it to its full form, no functionality change.
Signed-off-by Yucong Sun <[email protected]>--- tools/bpf/bpftool/gen.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
Here is the summary with links:
- [bpf-next] tools/bpftool: Avoid using "?:" in generated code
https://git.kernel.org/bpf/bpf-next/c/09710d82c0a3
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html