mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Dmitrii Bundin <dmitrii.bundin.a@gmail.com>, olsajiri@gmail.com
Cc: andrii@kernel.org, ast@kernel.org, bpf@vger.kernel.org,
	dxu@dxuuu.xyz, eddyz87@gmail.com, haoluo@google.com,
	john.fastabend@gmail.com, khazhy@chromium.org,
	kpsingh@kernel.org, linux-kernel@vger.kernel.org,
	martin.lau@linux.dev, ncopa@alpinelinux.org,
	ndesaulniers@google.com, sdf@google.com, song@kernel.org,
	vmalik@redhat.com, yonghong.song@linux.dev
Subject: Re: [PATCH bpf-next v3] bpf: btf: include linux/types.h for u32
Date: Fri, 26 Apr 2024 17:54:28 +0200	[thread overview]
Message-ID: <9ca4b5dd-20be-79ac-52eb-a19c0c82280f@iogearbox.net> (raw)
In-Reply-To: <20240420042457.3198883-1-dmitrii.bundin.a@gmail.com>

On 4/20/24 6:24 AM, Dmitrii Bundin wrote:
> Inclusion of the header linux/btf_ids.h relies on indirect inclusion of
> the header linux/types.h. Including it directly on the top level helps
> to avoid potential problems if linux/types.h hasn't been included
> before.
> 
> The main motiviation to introduce this it is to avoid similar problems that

nit: spelling

> was shown up in the bpf tool where GNU libc indirectly pulls
> linux/types.h causing compile error of the form:
> 
>     error: unknown type name 'u32'
>                               u32 cnt;
>                               ^~~
> 
> The bpf tool compile error was fixed at 62248b22d01e96a4d669cde0d7005bd51ebf9e76
> 
> Fixes: 9707ac4fe2f5 ("tools/resolve_btfids: Refactor set sorting with types from btf_ids.h")
> 
> Signed-off-by: Dmitrii Bundin <dmitrii.bundin.a@gmail.com>
> ---
> 
> Changes in v2: Add bpf-next to the subject
> Changes in v3: Add Fixes tag and bpf tool commit reference
> 
>   include/linux/btf_ids.h | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/include/linux/btf_ids.h b/include/linux/btf_ids.h
> index e24aabfe8ecc..c0e3e1426a82 100644
> --- a/include/linux/btf_ids.h
> +++ b/include/linux/btf_ids.h
> @@ -3,6 +3,8 @@
>   #ifndef _LINUX_BTF_IDS_H
>   #define _LINUX_BTF_IDS_H
>   
> +#include <linux/types.h> /* for u32 */
> +
>   struct btf_id_set {
>   	u32 cnt;
>   	u32 ids[];
> 

Lgtm, not sure if its worth it but also doesn't hurt and aligns the header
from tooling a bit closer to the kernel one. Just to clarify, this does not
fix a concrete issue today, so small 'cleanup' rather than 'fix'.

Thanks,
Daniel

  reply	other threads:[~2024-04-26 15:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-14  4:51 [PATCH] " Dmitrii Bundin
2024-04-15 12:11 ` Jiri Olsa
2024-04-16  5:15   ` [PATCH bpf-next v2] " Dmitrii Bundin
2024-04-16  7:23     ` Jiri Olsa
2024-04-16  5:27   ` [PATCH] " Dmitrii Bundin
2024-04-16  7:28     ` Jiri Olsa
2024-04-16 14:47       ` Daniel Borkmann
2024-04-17  6:26         ` Dmitrii Bundin
2024-04-17  7:17           ` Jiri Olsa
2024-04-20  4:24             ` [PATCH bpf-next v3] " Dmitrii Bundin
2024-04-26 15:54               ` Daniel Borkmann [this message]
2024-04-29 23:33                 ` Andrii Nakryiko
2024-04-29 23:40               ` 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=9ca4b5dd-20be-79ac-52eb-a19c0c82280f@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=dmitrii.bundin.a@gmail.com \
    --cc=dxu@dxuuu.xyz \
    --cc=eddyz87@gmail.com \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=khazhy@chromium.org \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=ncopa@alpinelinux.org \
    --cc=ndesaulniers@google.com \
    --cc=olsajiri@gmail.com \
    --cc=sdf@google.com \
    --cc=song@kernel.org \
    --cc=vmalik@redhat.com \
    --cc=yonghong.song@linux.dev \
    /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

all inboxes | Powered by JetHome®