[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <068479a445bbedc0c50f50f817f6236444dc4809e9a8a0fdefc9216a3832c864@mail.kernel.org>
Date: Wed, 31 Dec 2025 09:48:20 +0000 (UTC)
From: bot+bpf-ci@...nel.org
To: kiraskyler@....com,qmo@...nel.org
Cc: ast@...nel.org,daniel@...earbox.net,andrii@...nel.org,martin.lau@...ux.dev,eddyz87@...il.com,song@...nel.org,yonghong.song@...ux.dev,john.fastabend@...il.com,kpsingh@...nel.org,sdf@...ichev.me,haoluo@...gle.com,jolsa@...nel.org,kiraskyler@....com,menglong8.dong@...il.com,bpf@...r.kernel.org,linux-kernel@...r.kernel.org,niuwl1@...natelecom.cn,dongml2@...natelecom.cn,ast@...nel.org,andrii@...nel.org,daniel@...earbox.net,martin.lau@...nel.org,eddyz87@...il.com,yonghong.song@...ux.dev,clm@...a.com,ihor.solodrai@...ux.dev
Subject: Re: [PATCH bpf-next] bpftool: Make skeleton C++ compatible with explicit casts
> diff --git a/tools/bpf/bpftool/gen.c b/tools/bpf/bpftool/gen.c
> index 993c7d9484a4..71446a776130 100644
> --- a/tools/bpf/bpftool/gen.c
> +++ b/tools/bpf/bpftool/gen.c
> @@ -731,10 +731,10 @@ static int gen_trace(struct bpf_object *obj, const char *obj_name, const char *h
> { \n\
> struct %1$s *skel; \n\
> \n\
> - skel = skel_alloc(sizeof(*skel)); \n\
> + skel = (struct trace_bpf *)skel_alloc(sizeof(*skel));\n\
^^^^^^^^^
Should this cast use (struct %1$s *) instead of (struct trace_bpf *)?
The variable skel is declared as "struct %1$s *skel" where %1$s is replaced
with obj_name, but the cast hardcodes "trace_bpf" regardless of what skeleton
is being generated. This would cause C++ compilation errors for any BPF
object with a name other than trace_bpf.
For comparison, the non-loader skeleton at do_skeleton() correctly uses
"(struct %1$s *)calloc()" to match the skeleton name.
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/20616299845
Powered by blists - more mailing lists