diff options
-rwxr-xr-x | scripts/checkpatch.pl | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index cb19f54b4b2a..e44ff91e811d 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -1400,18 +1400,34 @@ sub process { | |||
1400 | } | 1400 | } |
1401 | 1401 | ||
1402 | # check for Kconfig help text having a real description | 1402 | # check for Kconfig help text having a real description |
1403 | # Only applies when adding the entry originally, after that we do not have | ||
1404 | # sufficient context to determine whether it is indeed long enough. | ||
1403 | if ($realfile =~ /Kconfig/ && | 1405 | if ($realfile =~ /Kconfig/ && |
1404 | $line =~ /\+?\s*(---)?help(---)?$/) { | 1406 | $line =~ /\+\s*(?:---)?help(?:---)?$/) { |
1405 | my $length = 0; | 1407 | my $length = 0; |
1406 | for (my $l = $linenr; defined($lines[$l]); $l++) { | 1408 | my $cnt = $realcnt; |
1407 | my $f = $lines[$l]; | 1409 | my $ln = $linenr + 1; |
1410 | my $f; | ||
1411 | my $is_end = 0; | ||
1412 | while ($cnt > 0 && defined $lines[$ln - 1]) { | ||
1413 | $f = $lines[$ln - 1]; | ||
1414 | $cnt-- if ($lines[$ln - 1] !~ /^-/); | ||
1415 | $is_end = $lines[$ln - 1] =~ /^\+/; | ||
1416 | $ln++; | ||
1417 | |||
1418 | next if ($f =~ /^-/); | ||
1419 | $f =~ s/^.//; | ||
1408 | $f =~ s/#.*//; | 1420 | $f =~ s/#.*//; |
1409 | $f =~ s/^\s+//; | 1421 | $f =~ s/^\s+//; |
1410 | next if ($f =~ /^$/); | 1422 | next if ($f =~ /^$/); |
1411 | last if ($f =~ /^\s*config\s/); | 1423 | if ($f =~ /^\s*config\s/) { |
1424 | $is_end = 1; | ||
1425 | last; | ||
1426 | } | ||
1412 | $length++; | 1427 | $length++; |
1413 | } | 1428 | } |
1414 | WARN("please write a paragraph that describes the config symbol fully\n" . $herecurr) if ($length < 4); | 1429 | WARN("please write a paragraph that describes the config symbol fully\n" . $herecurr) if ($is_end && $length < 4); |
1430 | #print "is_end<$is_end> length<$length>\n"; | ||
1415 | } | 1431 | } |
1416 | 1432 | ||
1417 | # check we are in a valid source file if not then ignore this hunk | 1433 | # check we are in a valid source file if not then ignore this hunk |