lkml.org 
[lkml]   [2015]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH V2] checkpatch: don't ask for asm/file.h to linux/file.h unconditionally
    From
    Date
    On Tue, 2015-03-31 at 21:06 +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
    []
    > @@ -4242,13 +4242,16 @@ sub process {
    > }
    > }
    >
    > -#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 -Ec "#include\\s+<asm/$file>" $root/$checkfile`;

    I think it'd be better to move this into the if below so
    that the grep is done only when $root/$checkfile exists.

    > 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",





    \
     
     \ /
      Last update: 2015-03-31 21:41    [W:3.215 / U:0.112 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site