History

staging: Remove unnecessary semicolons when switch (foo) {...};

Done via perl script: $ cat remove_semi_switch.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(switch\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); } } $

Joe Perches committed 15 years ago

Commit 95cd17c1 parent 273f4be16 files · +26 −26Browse files

Showing the changes to drivers/staging/lirc/lirc_serial.c (1 of 16 files). Show all

Unified · Split

drivers/staging/lirc/lirc_serial.c+1−1
@@ -919,7 +919,7 @@ static int set_use_inc(void *data) · 918 unmodified lines
919919 default:
920920 dprintk("Interrupt %d, port %04x obtained\n", irq, io);
921921 break;
922− };
922+ }
923923
924924 spin_lock_irqsave(&hardware[type].lock, flags);
925925