Skip to content

Commit 495e9d8

Browse files
JoePerchestorvalds
authored andcommitted
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 <[email protected]> Acked-by: David Howells <[email protected]> Acked-by: Andy Whitcroft <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 5abe257 commit 495e9d8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

scripts/checkpatch.pl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2226,8 +2226,11 @@ sub process {
22262226
my $path = $1;
22272227
if ($path =~ m{//}) {
22282228
ERROR("MALFORMED_INCLUDE",
2229-
"malformed #include filename\n" .
2230-
$herecurr);
2229+
"malformed #include filename\n" . $herecurr);
2230+
}
2231+
if ($path =~ "^uapi/" && $realfile =~ m@\binclude/uapi/@) {
2232+
ERROR("UAPI_INCLUDE",
2233+
"No #include in ...include/uapi/... should use a uapi/ path prefix\n" . $herecurr);
22312234
}
22322235
}
22332236

0 commit comments

Comments
 (0)