diff mbox series

[bpf-next] tools/bpftool: Avoid using "?:" in generated code

Message ID 20210928184221.1545079-1-fallentree@fb.com (mailing list archive)
State Accepted
Commit 09710d82c0a3469eadc32781721ac2336fdf915d
Delegated to: BPF
Headers show
Series [bpf-next] tools/bpftool: Avoid using "?:" in generated code | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for bpf-next
netdev/subject_prefix success Link
netdev/cc_maintainers warning 11 maintainers not CCed: ast@kernel.org kpsingh@kernel.org kafai@fb.com netdev@vger.kernel.org alastorze@fb.com john.fastabend@gmail.com quentin@isovalent.com daniel@iogearbox.net toke@redhat.com songliubraving@fb.com yhs@fb.com
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch fail ERROR: trailing statements should be on next line
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

Yucong Sun Sept. 28, 2021, 6:42 p.m. UTC
"?:" 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 <fallentree@fb.com>
---
 tools/bpf/bpftool/gen.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

patchwork-bot+netdevbpf@kernel.org Sept. 28, 2021, 10:30 p.m. UTC | #1
Hello:

This patch was applied to bpf/bpf-next.git (refs/heads/master):

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 <fallentree@fb.com>
> ---
>  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
diff mbox series

Patch

diff --git a/tools/bpf/bpftool/gen.c b/tools/bpf/bpftool/gen.c
index e3ec47a6a612..cc835859465b 100644
--- a/tools/bpf/bpftool/gen.c
+++ b/tools/bpf/bpftool/gen.c
@@ -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\