summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2017-07-10 15:52:07 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-10 16:32:35 -0700
commit628f91a28649d063a048629d9d15b3e5c4dcaa37 (patch)
treeedfc0fc7e2e9fd3ce7b4d493b9cde341e066448f
parentfb0d0e088e194e7d966c9a1b3c58900664e5d7db (diff)
downloadlinux-628f91a28649d063a048629d9d15b3e5c4dcaa37.tar.bz2
checkpatch: warn when a MAINTAINERS entry isn't [A-Z]:\t
For consistency, MAINTAINERS entries should be an upper case letter, then a colon, then a tab, then the value. Warn when an entry doesn't have this form. --fix it too. Link: http://lkml.kernel.org/r/9aaaf03ec10adf3888b5e98dd2176b7fe9b5fad8.1496343345.git.joe@perches.com Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rwxr-xr-xscripts/checkpatch.pl11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 907e079e59fd..3cf05505e833 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2776,6 +2776,17 @@ sub process {
#print "is_start<$is_start> is_end<$is_end> length<$length>\n";
}
+# check for MAINTAINERS entries that don't have the right form
+ if ($realfile =~ /^MAINTAINERS$/ &&
+ $rawline =~ /^\+[A-Z]:/ &&
+ $rawline !~ /^\+[A-Z]:\t\S/) {
+ if (WARN("MAINTAINERS_STYLE",
+ "MAINTAINERS entries use one tab after TYPE:\n" . $herecurr) &&
+ $fix) {
+ $fixed[$fixlinenr] =~ s/^(\+[A-Z]):\s*/$1:\t/;
+ }
+ }
+
# discourage the use of boolean for type definition attributes of Kconfig options
if ($realfile =~ /Kconfig/ &&
$line =~ /^\+\s*\bboolean\b/) {