2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-07 05:04:04 +08:00
linux-next/drivers/staging/comedi
Joe Perches 95cd17c9f3 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);
    }
}

$

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-25 16:58:35 -07:00
..
drivers staging: Remove unnecessary semicolons when switch (foo) {...}; 2011-04-25 16:58:35 -07:00
kcomedilib Staging: comedi: kcomedilib: fix coding style issues in kcomedilib_main.c 2010-07-08 13:15:16 -07:00
comedi_compat32.c Staging: comedi: range.c: properly mark up __user pointers 2010-05-11 11:36:03 -07:00
comedi_compat32.h Staging: comedi: remove check for HAVE_COMPAT_IOCTL 2009-12-11 12:23:01 -08:00
comedi_fops.c Fix common misspellings 2011-03-31 11:26:23 -03:00
comedi_fops.h Staging: comedi: fix up remaining coding style issue in proc.c 2010-05-11 11:35:58 -07:00
comedi.h Staging: comedi: Fixed more long line lengths in comedi.h 2010-05-14 13:53:19 -07:00
comedidev.h Staging: comedi: Remove COMEDI_PCI_INITCLEANUP macro 2010-06-17 13:48:12 -07:00
comedilib.h Staging: comedi: kcomedilib: make it typesafe 2010-05-11 11:36:02 -07:00
drivers.c staging: comedi: fix coding style issue in drivers.c 2011-02-04 13:04:24 -08:00
internal.h Staging: comedi: drivers.c sparse cleanup 2010-05-11 11:36:03 -07:00
Kconfig Staging: Comedi: Fix a few NI module dependencies 2011-02-09 11:39:50 -08:00
Makefile Staging: comedi: Makefile: replace the use of <module>-objs with <module>-y 2010-10-08 07:23:52 -07:00
proc.c Staging: comedi: clean up sparse issues in proc.c 2010-05-11 11:36:03 -07:00
range.c Staging: comedi: range.c: properly mark up __user pointers 2010-05-11 11:36:03 -07:00
TODO Staging: comedi: Remove typedefs 2010-06-17 13:49:07 -07:00