[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1749171922.215740.1427828957699.open-xchange@webmail.nmp.proximus.be>
Date: Tue, 31 Mar 2015 21:09:17 +0200 (CEST)
From: Fabian Frederick <fabf@...net.be>
To: Joe Perches <joe@...ches.com>
Cc: linux-kernel@...r.kernel.org, Andy Whitcroft <apw@...onical.com>
Subject: Re: [RFC 1/1 linux-next] checkpatch: don't ask for asm/file.h to
linux/file.h unconditionally
> On 30 March 2015 at 22:49 Joe Perches <joe@...ches.com> wrote:
>
>
> On Mon, 2015-03-30 at 22:36 +0200, Fabian Frederick wrote:
> > Currently checkpatch warns when asm/file.h is included and linux/file.h
> > exists. That conversion can be made when linux/file.h includes asm/file.h
> > which is not always the case.(See signal.h)
> []
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> []
> > -#warn if <asm/foo.h> is #included and <linux/foo.h> is available (uses RAW
> > line)
> > +# warn if <asm/foo.h> is #included and <linux/foo.h> is available and
> > includes
> > +# itself <asm/foo.h> (uses RAW line)
> > if ($tree && $rawline =~
> >m{^.\s*\#\s*include\s*\<asm\/(.*)\.h\>}) {
> > my $file = "$1.h";
> > my $checkfile = "include/linux/$file";
> > + my $asminclude = `grep -ci "#include <asm/$file.h>"
> > $checkfile`;
>
> This won't work with #include forms like:
> #include <asm/foo.h>
> or when checkpatch is run from somewhere other
> than the top of tree.
>
> why the -i?
Hi Joe,
This was just an RFC. I guess you're ok with the idea so I added your
suggestions in V2.
Regards,
Fabian
>
> > if (-f "$root/$checkfile" &&
> > $realfile ne $checkfile &&
> > - $1 !~ /$allowed_asm_includes/)
> > + $1 !~ /$allowed_asm_includes/ &&
> > + $asminclude > 0 )
> > {
> > if ($realfile =~ m{^arch/}) {
> > CHK("ARCH_INCLUDE_LINUX",
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists