summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-12-21 00:05:37 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-21 02:40:20 +0100
commit495e9d84607cda966ba6d223d5eb9df0070cd21a (patch)
tree208667895c3646fe4fa1bb7322d0ed1f51880ca5
parentrevert "rtc: recycle id when unloading a rtc driver" (diff)
downloadlinux-495e9d84607cda966ba6d223d5eb9df0070cd21a.tar.xz
linux-495e9d84607cda966ba6d223d5eb9df0070cd21a.zip
checkpatch: warn on uapi #includes that #include <uapi/...
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> Acked-by: David Howells <dhowells@redhat.com> Acked-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rwxr-xr-xscripts/checkpatch.pl7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 1d6e4c541370..4d2c7dfdaabd 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2226,8 +2226,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);
}
}