aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2010-05-24 17:33:29 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-25 11:07:06 -0400
commit3354957a4f8b9bb4b43625232acdf0626851c82f (patch)
tree8b6b363e9114611a3261c600f937bce75c81cbdd /scripts/checkpatch.pl
parent965fd9e9a2d6d0a2704815e4579008a9f65282a0 (diff)
checkpatch: add check for too short Kconfig descriptions
I've seen various new Kconfigs with rather unhelpful one liner descriptions. Add a Kconfig warning for a minimum length of the Kconfig help section. Right now I arbitarily chose 4. The exact value can be debated. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Andi Kleen <ak@linux.intel.com> Cc: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl15
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index f2bbea900700..de0f4672cb74 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1382,6 +1382,21 @@ sub process {
1382 ERROR("trailing whitespace\n" . $herevet); 1382 ERROR("trailing whitespace\n" . $herevet);
1383 } 1383 }
1384 1384
1385# check for Kconfig help text having a real description
1386 if ($realfile =~ /Kconfig/ &&
1387 $line =~ /\+?\s*(---)?help(---)?$/) {
1388 my $length = 0;
1389 for (my $l = $linenr; defined($lines[$l]); $l++) {
1390 my $f = $lines[$l];
1391 $f =~ s/#.*//;
1392 $f =~ s/^\s+//;
1393 next if ($f =~ /^$/);
1394 last if ($f =~ /^\s*config\s/);
1395 $length++;
1396 }
1397 WARN("please write a paragraph that describes the config symbol fully\n" . $herecurr) if ($length < 4);
1398 }
1399
1385# check we are in a valid source file if not then ignore this hunk 1400# check we are in a valid source file if not then ignore this hunk
1386 next if ($realfile !~ /\.(h|c|s|S|pl|sh)$/); 1401 next if ($realfile !~ /\.(h|c|s|S|pl|sh)$/);
1387 1402