aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/checkpatch.pl10
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index e7c8ab1b54bd..8616baee0aeb 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1269,8 +1269,8 @@ sub process {
1269 $ctx_ln++; 1269 $ctx_ln++;
1270 } 1270 }
1271 1271
1272 ##print "realcnt<$realcnt> ctx_cnt<$ctx_cnt>\n"; 1272 #print "realcnt<$realcnt> ctx_cnt<$ctx_cnt>\n";
1273 ##print "pre<$pre_ctx>\nline<$line>\nctx<$ctx>\nnext<$lines[$ctx_ln - 1]>\n"; 1273 #print "pre<$pre_ctx>\nline<$line>\nctx<$ctx>\nnext<$lines[$ctx_ln - 1]>\n";
1274 1274
1275 if ($ctx !~ /{\s*/ && defined($lines[$ctx_ln -1]) && $lines[$ctx_ln - 1] =~ /^\+\s*{/) { 1275 if ($ctx !~ /{\s*/ && defined($lines[$ctx_ln -1]) && $lines[$ctx_ln - 1] =~ /^\+\s*{/) {
1276 ERROR("that open brace { should be on the previous line\n" . 1276 ERROR("that open brace { should be on the previous line\n" .
@@ -1713,7 +1713,7 @@ sub process {
1713 } 1713 }
1714 1714
1715# Check for illegal assignment in if conditional. 1715# Check for illegal assignment in if conditional.
1716 if ($line =~ /\bif\s*\(/) { 1716 if ($line =~ /\b(?:if|while|for)\s*\(/ && $line !~ /^.\s*#/) {
1717 my ($s, $c) = ($stat, $cond); 1717 my ($s, $c) = ($stat, $cond);
1718 1718
1719 if ($c =~ /\bif\s*\(.*[^<>!=]=[^=].*/) { 1719 if ($c =~ /\bif\s*\(.*[^<>!=]=[^=].*/) {
@@ -1725,8 +1725,8 @@ sub process {
1725 substr($s, 0, length($c), ''); 1725 substr($s, 0, length($c), '');
1726 $s =~ s/\n.*//g; 1726 $s =~ s/\n.*//g;
1727 $s =~ s/$;//g; # Remove any comments 1727 $s =~ s/$;//g; # Remove any comments
1728 if (length($c) && $s !~ /^\s*({|;|)\s*\\*\s*$/ && 1728 if (length($c) && $s !~ /^\s*{?\s*\\*\s*$/ &&
1729 $c !~ /^.\s*\#\s*if/) 1729 $c !~ /}\s*while\s*/)
1730 { 1730 {
1731 ERROR("trailing statements should be on next line\n" . $herecurr); 1731 ERROR("trailing statements should be on next line\n" . $herecurr);
1732 } 1732 }