BPF List
 help / color / mirror / Atom feed
From: Stanislav Fomichev <sdf@fomichev.me>
To: Andrii Nakryiko <andrii@kernel.org>
Cc: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net,
	martin.lau@kernel.org, kernel-team@meta.com,
	Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH bpf-next] libbpf: fix no-args func prototype BTF dumping syntax
Date: Fri, 12 Jul 2024 18:01:15 -0700	[thread overview]
Message-ID: <ZpHR2xZwIh7IpVdL@mini-arch> (raw)
In-Reply-To: <20240712224442.282823-1-andrii@kernel.org>

On 07/12, Andrii Nakryiko wrote:
> For all these years libbpf's BTF dumper has been emitting not strictly
> valid syntax for function prototypes that have no input arguments.
> 
> Instead of `int (*blah)()` we should emit `int (*blah)(void)`.
> 
> This is not normally a problem, but it manifests when we get kfuncs in
> vmlinux.h that have no input arguments. Due to compiler internal
> specifics, we get no BTF information for such kfuncs, if they are not
> declared with proper `(void)`.
> 
> The fix is trivial. We also need to adjust a few ancient tests that
> happily assumed `()` is correct.
> 
> Reported-by: Tejun Heo <tj@kernel.org>
> Fixes: 351131b51c7a ("libbpf: add btf_dump API for BTF-to-C conversion")
> Signed-off-by: Andrii Nakryiko <andrii@kernel.org>

Acked-by: Stanislav Fomichev <sdf@fomichev.me>

  reply	other threads:[~2024-07-13  1:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-12 22:44 [PATCH bpf-next] libbpf: fix no-args func prototype BTF dumping syntax Andrii Nakryiko
2024-07-13  1:01 ` Stanislav Fomichev [this message]
2024-07-17 20:50 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZpHR2xZwIh7IpVdL@mini-arch \
    --to=sdf@fomichev.me \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@meta.com \
    --cc=martin.lau@kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox