diff options
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-x | scripts/checkpatch.pl | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 618c0b5db0be..d8ac16ab5e61 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -1674,19 +1674,26 @@ sub process { | |||
1674 | # Only applies when adding the entry originally, after that we do not have | 1674 | # Only applies when adding the entry originally, after that we do not have |
1675 | # sufficient context to determine whether it is indeed long enough. | 1675 | # sufficient context to determine whether it is indeed long enough. |
1676 | if ($realfile =~ /Kconfig/ && | 1676 | if ($realfile =~ /Kconfig/ && |
1677 | $line =~ /\+\s*(?:---)?help(?:---)?$/) { | 1677 | $line =~ /.\s*config\s+/) { |
1678 | my $length = 0; | 1678 | my $length = 0; |
1679 | my $cnt = $realcnt; | 1679 | my $cnt = $realcnt; |
1680 | my $ln = $linenr + 1; | 1680 | my $ln = $linenr + 1; |
1681 | my $f; | 1681 | my $f; |
1682 | my $is_start = 0; | ||
1682 | my $is_end = 0; | 1683 | my $is_end = 0; |
1683 | while ($cnt > 0 && defined $lines[$ln - 1]) { | 1684 | for (; $cnt > 0 && defined $lines[$ln - 1]; $ln++) { |
1684 | $f = $lines[$ln - 1]; | 1685 | $f = $lines[$ln - 1]; |
1685 | $cnt-- if ($lines[$ln - 1] !~ /^-/); | 1686 | $cnt-- if ($lines[$ln - 1] !~ /^-/); |
1686 | $is_end = $lines[$ln - 1] =~ /^\+/; | 1687 | $is_end = $lines[$ln - 1] =~ /^\+/; |
1687 | $ln++; | ||
1688 | 1688 | ||
1689 | next if ($f =~ /^-/); | 1689 | next if ($f =~ /^-/); |
1690 | |||
1691 | if ($lines[$ln - 1] =~ /.\s*(?:bool|tristate)\s*\"/) { | ||
1692 | $is_start = 1; | ||
1693 | } elsif ($lines[$ln - 1] =~ /.\s*(?:---)?help(?:---)?$/) { | ||
1694 | $length = -1; | ||
1695 | } | ||
1696 | |||
1690 | $f =~ s/^.//; | 1697 | $f =~ s/^.//; |
1691 | $f =~ s/#.*//; | 1698 | $f =~ s/#.*//; |
1692 | $f =~ s/^\s+//; | 1699 | $f =~ s/^\s+//; |
@@ -1698,8 +1705,8 @@ sub process { | |||
1698 | $length++; | 1705 | $length++; |
1699 | } | 1706 | } |
1700 | WARN("CONFIG_DESCRIPTION", | 1707 | WARN("CONFIG_DESCRIPTION", |
1701 | "please write a paragraph that describes the config symbol fully\n" . $herecurr) if ($is_end && $length < 4); | 1708 | "please write a paragraph that describes the config symbol fully\n" . $herecurr) if ($is_start && $is_end && $length < 4); |
1702 | #print "is_end<$is_end> length<$length>\n"; | 1709 | #print "is_start<$is_start> is_end<$is_end> length<$length>\n"; |
1703 | } | 1710 | } |
1704 | 1711 | ||
1705 | if (($realfile =~ /Makefile.*/ || $realfile =~ /Kbuild.*/) && | 1712 | if (($realfile =~ /Makefile.*/ || $realfile =~ /Kbuild.*/) && |