From: Joe Perches Date: Sun, 10 Apr 2011 21:31:33 +0000 (-0700) Subject: staging: Remove unnecessary semicolons when while (foo) {...}; X-Git-Tag: v3.0-rc1~336^2~707 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0b0fb0fd519c7597d6bf4de7be660788cf2232c;p=pandora-kernel.git staging: Remove unnecessary semicolons when while (foo) {...}; Done via perl script: $ cat remove_semi_while.pl my $match_balanced_parentheses = qr/(\((?:[^\(\)]++|(?-1))*\))/; my $match_balanced_braces = qr/(\{(?:[^\{\}]++|(?-1))*\})/; foreach my $file (@ARGV) { my $f; my $text; my $oldtext; next if ((-d $file)); open($f, '<', $file) or die "$P: Can't open $file for read\n"; $oldtext = do { local($/) ; <$f> }; close($f); next if ($oldtext eq ""); $text = $oldtext; my $count = 0; do { $count = 0; $count += $text =~ s@\b(while\s*${match_balanced_parentheses}\s*)${match_balanced_braces}\s*;@"$1$3"@egx; } while ($count > 0); if ($text ne $oldtext) { my $newfile = $file; open($f, '>', $newfile) or die "$P: Can't open $newfile for write\n"; print $f $text; close($f); } } $ One false positive removed. Signed-off-by: Joe Perches Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed