mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Fabian Frederick <fabf@skynet.be>
Cc: linux-kernel@vger.kernel.org, Andy Whitcroft <apw@canonical.com>
Subject: Re: [RFC 1/1 linux-next] checkpatch: don't ask for asm/file.h to linux/file.h unconditionally
Date: Mon, 30 Mar 2015 13:49:03 -0700	[thread overview]
Message-ID: <1427748543.14276.32.camel@perches.com> (raw)
In-Reply-To: <1427747804-20714-1-git-send-email-fabf@skynet.be>

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?

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



  reply	other threads:[~2015-03-30 20:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-30 20:36 Fabian Frederick
2015-03-30 20:49 ` Joe Perches [this message]
2015-03-31 19:09   ` Fabian Frederick

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=1427748543.14276.32.camel@perches.com \
    --to=joe@perches.com \
    --cc=apw@canonical.com \
    --cc=fabf@skynet.be \
    --cc=linux-kernel@vger.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

all inboxes | Powered by JetHome®