From 9097f2c7064ee93bf15b41a72f1d2d67c5238596 Mon Sep 17 00:00:00 2001 From: Andy Whitcroft Date: Tue, 26 Oct 2010 14:23:15 -0700 Subject: [PATCH] --- yaml --- r: 217589 b: refs/heads/master c: 9fe287d79b0af983050d24e7916cf3d1f019f553 h: refs/heads/master i: 217587: 3c554b45bf0b5c1b1f0a4f9b059b958e511ad71c v: v3 --- [refs] | 2 +- trunk/scripts/checkpatch.pl | 26 +++++++++++++++++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 796d5ae1ceb2..9c1160b7e708 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0c73b4eb7a825a5aff16d8a9701f6c28056de058 +refs/heads/master: 9fe287d79b0af983050d24e7916cf3d1f019f553 diff --git a/trunk/scripts/checkpatch.pl b/trunk/scripts/checkpatch.pl index cb19f54b4b2a..e44ff91e811d 100755 --- a/trunk/scripts/checkpatch.pl +++ b/trunk/scripts/checkpatch.pl @@ -1400,18 +1400,34 @@ sub process { } # check for Kconfig help text having a real description +# Only applies when adding the entry originally, after that we do not have +# sufficient context to determine whether it is indeed long enough. if ($realfile =~ /Kconfig/ && - $line =~ /\+?\s*(---)?help(---)?$/) { + $line =~ /\+\s*(?:---)?help(?:---)?$/) { my $length = 0; - for (my $l = $linenr; defined($lines[$l]); $l++) { - my $f = $lines[$l]; + my $cnt = $realcnt; + my $ln = $linenr + 1; + my $f; + my $is_end = 0; + while ($cnt > 0 && defined $lines[$ln - 1]) { + $f = $lines[$ln - 1]; + $cnt-- if ($lines[$ln - 1] !~ /^-/); + $is_end = $lines[$ln - 1] =~ /^\+/; + $ln++; + + next if ($f =~ /^-/); + $f =~ s/^.//; $f =~ s/#.*//; $f =~ s/^\s+//; next if ($f =~ /^$/); - last if ($f =~ /^\s*config\s/); + if ($f =~ /^\s*config\s/) { + $is_end = 1; + last; + } $length++; } - WARN("please write a paragraph that describes the config symbol fully\n" . $herecurr) if ($length < 4); + WARN("please write a paragraph that describes the config symbol fully\n" . $herecurr) if ($is_end && $length < 4); + #print "is_end<$is_end> length<$length>\n"; } # check we are in a valid source file if not then ignore this hunk