Re: [PATCH] bpf: btf: include linux/types.h for u32
From: Jiri Olsa
Date: Mon Apr 15 2024 - 08:12:37 EST
please use '[PATCH bpf-next]' in subject
On Sun, Apr 14, 2024 at 07:51:24AM +0300, 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.
>
> Signed-off-by: Dmitrii Bundin <dmitrii.bundin.a@xxxxxxxxx>
> ---
> 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 */
lgtm, did it actualy cause problem anywhere?
there's also tools/include/linux/btf_ids.h
jirka
> +
> struct btf_id_set {
> u32 cnt;
> u32 ids[];
> --
> 2.34.1
>