[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CABJPP5Bg_Ewgsu_J+Bz-VGaa+D3W-wRg-_2f-590HZWLL-K=5g@mail.gmail.com>
Date: Mon, 23 Nov 2020 14:34:49 +0530
From: Dwaipayan Ray <dwaipayanray1@...il.com>
To: Joe Perches <joe@...ches.com>
Cc: linux-kernel-mentees@...ts.linuxfoundation.org,
linux-kernel <linux-kernel@...r.kernel.org>,
Lukas Bulwahn <lukas.bulwahn@...il.com>
Subject: Re: [PATCH v2] checkpatch: add --fix option for INCLUDE_LINUX
On Sun, Nov 22, 2020 at 2:54 AM Dwaipayan Ray <dwaipayanray1@...il.com> wrote:
>
> Provide fix option to INCLUDE_LINUX check to replace asm
> includes.
>
> Macros of type:
> #include <asm/percpu.h>
>
> are corrected to:
> #include <linux/percpu.h>
>
> Signed-off-by: Dwaipayan Ray <dwaipayanray1@...il.com>
> ---
>
Hello Joe,
Could I get some review on this if you are not too busy.
Thank you,
Dwaipayan.
> Changes in v2:
> - Use \Q..\E quoting
> - Use @ as regex delimiter
>
> scripts/checkpatch.pl | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 0da6422cd0fd..e4feb91a0fe4 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -5468,8 +5468,11 @@ sub process {
> CHK("ARCH_INCLUDE_LINUX",
> "Consider using #include <linux/$file> instead of <asm/$file>\n" . $herecurr);
> } else {
> - WARN("INCLUDE_LINUX",
> - "Use #include <linux/$file> instead of <asm/$file>\n" . $herecurr);
> + if (WARN("INCLUDE_LINUX",
> + "Use #include <linux/$file> instead of <asm/$file>\n" . $herecurr) &&
> + $fix) {
> + $fixed[$fixlinenr] =~ s@\Q<asm/$file>\E@<linux/$file>@;
> + }
> }
> }
> }
> --
> 2.27.0
>
Powered by blists - more mailing lists