From ab63d849bd2c4b7ad80076c55245a92b2181af55 Mon Sep 17 00:00:00 2001 From: Andy Whitcroft Date: Wed, 23 Jul 2008 21:29:03 -0700 Subject: [PATCH] --- yaml --- r: 105391 b: refs/heads/master c: 53210168feeff9a3c780bd42f69936d4c12381d5 h: refs/heads/master i: 105389: 4c29588319fbf01f4076e15af1602180e7eeef52 105387: 2a7b334310660c834d28d5b02b60c5660eddbe1d 105383: eda13a71b06a94287ad59101180bff8e81c15d26 105375: 51ee4680910f1bf37bc0eb4d1a313056764a4929 v: v3 --- [refs] | 2 +- trunk/scripts/checkpatch.pl | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index dae6cb36b948..060429c7430c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8d31cfcecf67563d70cd68616cb8fb4384f24b51 +refs/heads/master: 53210168feeff9a3c780bd42f69936d4c12381d5 diff --git a/trunk/scripts/checkpatch.pl b/trunk/scripts/checkpatch.pl index e7c8ab1b54bd..8616baee0aeb 100755 --- a/trunk/scripts/checkpatch.pl +++ b/trunk/scripts/checkpatch.pl @@ -1269,8 +1269,8 @@ sub process { $ctx_ln++; } - ##print "realcnt<$realcnt> ctx_cnt<$ctx_cnt>\n"; - ##print "pre<$pre_ctx>\nline<$line>\nctx<$ctx>\nnext<$lines[$ctx_ln - 1]>\n"; + #print "realcnt<$realcnt> ctx_cnt<$ctx_cnt>\n"; + #print "pre<$pre_ctx>\nline<$line>\nctx<$ctx>\nnext<$lines[$ctx_ln - 1]>\n"; if ($ctx !~ /{\s*/ && defined($lines[$ctx_ln -1]) && $lines[$ctx_ln - 1] =~ /^\+\s*{/) { ERROR("that open brace { should be on the previous line\n" . @@ -1713,7 +1713,7 @@ sub process { } # Check for illegal assignment in if conditional. - if ($line =~ /\bif\s*\(/) { + if ($line =~ /\b(?:if|while|for)\s*\(/ && $line !~ /^.\s*#/) { my ($s, $c) = ($stat, $cond); if ($c =~ /\bif\s*\(.*[^<>!=]=[^=].*/) { @@ -1725,8 +1725,8 @@ sub process { substr($s, 0, length($c), ''); $s =~ s/\n.*//g; $s =~ s/$;//g; # Remove any comments - if (length($c) && $s !~ /^\s*({|;|)\s*\\*\s*$/ && - $c !~ /^.\s*\#\s*if/) + if (length($c) && $s !~ /^\s*{?\s*\\*\s*$/ && + $c !~ /}\s*while\s*/) { ERROR("trailing statements should be on next line\n" . $herecurr); }