public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Whitcroft <apw@canonical.com>
To: Joe Perches <joe@perches.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Alexander Graf <agraf@suse.de>,
	David Howells <dhowells@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2] checkpatch: Warn on uapi #includes that #include <uapi/...
Date: Wed, 19 Dec 2012 13:31:07 +0000	[thread overview]
Message-ID: <20121219133107.GZ8798@dm> (raw)
In-Reply-To: <836be70329567778096e6a5b9e898a85238b382c.1355879564.git.joe@perches.com>

On Tue, Dec 18, 2012 at 05:30:58PM -0800, Joe Perches wrote:
> Avoid specifying internal uapi #include paths with uapi/...
> as userspace should not use and never see that.
> 
> Neaten message line wrapping above.
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> cc: David Howells <dhowells@redhat.com>
> ---
>  scripts/checkpatch.pl |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 054a293..5eab67e 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -2238,8 +2238,11 @@ sub process {
>  			my $path = $1;
>  			if ($path =~ m{//}) {
>  				ERROR("MALFORMED_INCLUDE",
> -				      "malformed #include filename\n" .
> -					$herecurr);
> +				      "malformed #include filename\n" . $herecurr);
> +			}
> +			if ($path =~ "^uapi/" && $realfile =~ m@\binclude/uapi/@) {
> +				ERROR("UAPI_INCLUDE",
> +				      "No #include in ...include/uapi/... should use a uapi/ path prefix\n" . $herecurr);
>  			}
>  		}
>  

Looks reasonable indeed.

Acked-by: Andy Whitcroft <apw@canonical.com>

-apw

      parent reply	other threads:[~2012-12-19 13:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-18 14:23 checkpatch.pl should check UAPI headers don't #include <uapi/...> David Howells
2012-12-18 17:53 ` [PATCH] checkpatch: Warn on #include <uapi/ Joe Perches
2012-12-18 19:17   ` David Howells
2012-12-18 19:52     ` Joe Perches
2012-12-18 20:35       ` David Howells
2012-12-18 22:14         ` Joe Perches
2012-12-18 22:35           ` David Howells
2012-12-19  1:30             ` [PATCH V2] checkpatch: Warn on uapi #includes that " Joe Perches
2012-12-19 13:18               ` David Howells
2012-12-19 13:31               ` Andy Whitcroft [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=20121219133107.GZ8798@dm \
    --to=apw@canonical.com \
    --cc=agraf@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /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