Commit 495e9d84 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds
Browse files

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: default avatarJoe Perches <joe@perches.com>
Acked-by: default avatarDavid Howells <dhowells@redhat.com>
Acked-by: default avatarAndy Whitcroft <apw@canonical.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 5abe257a
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -2226,8 +2226,11 @@ sub process {
			my $path = $1;
			my $path = $1;
			if ($path =~ m{//}) {
			if ($path =~ m{//}) {
				ERROR("MALFORMED_INCLUDE",
				ERROR("MALFORMED_INCLUDE",
				      "malformed #include filename\n" .
				      "malformed #include filename\n" . $herecurr);
					$herecurr);
			}
			if ($path =~ "^uapi/" && $realfile =~ m@\binclude/uapi/@) {
				ERROR("UAPI_INCLUDE",
				      "No #include in ...include/uapi/... should use a uapi/ path prefix\n" . $herecurr);
			}
			}
		}
		}