public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Martin KaFai Lau <martin.lau@linux.dev>
To: George Guo <guodongtai@kylinos.cn>
Cc: masahiroy@kernel.org, nathan@kernel.org, bpf@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org
Subject: Re: [PATCH] btf: Remove unnecessary header file inclusions
Date: Tue, 25 Jul 2023 16:29:21 -0700	[thread overview]
Message-ID: <d5bce711-cef0-2929-2126-50105b6d807e@linux.dev> (raw)
In-Reply-To: <20230721075007.4100863-1-guodongtai@kylinos.cn>

On 7/21/23 12:50 AM, George Guo wrote:
> Remove unnecessary header file inclusions in btf.c
> 
> Signed-off-by: George Guo <guodongtai@kylinos.cn>
> ---
>   kernel/bpf/btf.c | 16 ----------------
>   1 file changed, 16 deletions(-)
> 
> diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
> index 817204d53372..e5ea729ba6b8 100644
> --- a/kernel/bpf/btf.c
> +++ b/kernel/bpf/btf.c
> @@ -1,20 +1,7 @@
>   // SPDX-License-Identifier: GPL-2.0
>   /* Copyright (c) 2018 Facebook */
>   
> -#include <uapi/linux/btf.h>
> -#include <uapi/linux/bpf.h>
> -#include <uapi/linux/bpf_perf_event.h>
> -#include <uapi/linux/types.h>
> -#include <linux/seq_file.h>
> -#include <linux/compiler.h>
> -#include <linux/ctype.h>
> -#include <linux/errno.h>
> -#include <linux/slab.h>
>   #include <linux/anon_inodes.h>
> -#include <linux/file.h>
> -#include <linux/uaccess.h>
> -#include <linux/kernel.h>
> -#include <linux/idr.h>
>   #include <linux/sort.h>
>   #include <linux/bpf_verifier.h>
>   #include <linux/btf.h>
> @@ -22,9 +9,6 @@
>   #include <linux/bpf_lsm.h>
>   #include <linux/skmsg.h>
>   #include <linux/perf_event.h>
> -#include <linux/bsearch.h>
> -#include <linux/kobject.h>
> -#include <linux/sysfs.h>

What is the reason that needs this change and only to this file? There are other 
files that can do this kind of removal. Are you planning to make all the changes 
also?

afaict, they are here because this file is using something defined in them. Now 
it is depending on other header files implicitly including the removed headers.

>   
>   #include <net/netfilter/nf_bpf_link.h>
>   


      parent reply	other threads:[~2023-07-25 23:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-21  7:50 [PATCH] btf: Remove unnecessary header file inclusions George Guo
2023-07-25 21:40 ` Martin KaFai Lau
2023-07-25 23:29 ` Martin KaFai Lau [this message]

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=d5bce711-cef0-2929-2126-50105b6d807e@linux.dev \
    --to=martin.lau@linux.dev \
    --cc=bpf@vger.kernel.org \
    --cc=guodongtai@kylinos.cn \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=nathan@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