Commit 95cd17c9 authored by Joe Perches's avatar Joe Perches Committed by Greg Kroah-Hartman
Browse files

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: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 273f4bef
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -4230,7 +4230,7 @@ ar6000_connect_event(struct ar6_softc *ar, u16 channel, u8 *bssid,
            default:
                A_PRINTF("AUTH: Unknown\n");
                break;
        };
        }
        switch (listenInterval&0xFF) {
            case WPA_PSK_AUTH:
                A_PRINTF("KeyMgmt: WPA-PSK\n");
@@ -4241,7 +4241,7 @@ ar6000_connect_event(struct ar6_softc *ar, u16 channel, u8 *bssid,
            default:
                A_PRINTF("KeyMgmt: NONE\n");
                break;
        };
        }
        switch (beaconInterval) {
            case AES_CRYPT:
                A_PRINTF("Cipher: AES\n");
@@ -4260,7 +4260,7 @@ ar6000_connect_event(struct ar6_softc *ar, u16 channel, u8 *bssid,
            default:
                A_PRINTF("Cipher: NONE\n");
                break;
        };
        }

        add_new_sta(ar, bssid, channel /*aid*/,
            assocInfo /* WPA IE */, assocRespLen /* IE len */,
+2 −2
Original line number Diff line number Diff line
@@ -1417,7 +1417,7 @@ static int pci9118_ai_docmd_sampl(struct comedi_device *dev,
		comedi_error(dev,
			     "pci9118_ai_docmd_sampl() mode number bug!\n");
		return -EIO;
	};
	}

	devpriv->int_ai_func = interrupt_pci9118_ai_onesample;
						/* transfer function */
@@ -1496,7 +1496,7 @@ static int pci9118_ai_docmd_dma(struct comedi_device *dev,
	default:
		comedi_error(dev, "pci9118_ai_docmd_dma() mode number bug!\n");
		return -EIO;
	};
	}

	if (devpriv->ai12_startstop) {
		pci9118_exttrg_add(dev, EXTTRG_AI);
+1 −1
Original line number Diff line number Diff line
@@ -650,7 +650,7 @@ static int cb_pcidda_ao_winsn(struct comedi_device *dev,
	case 5:
		command |= UNIP | RANGE2V5;
		break;
	};
	}

	/* output channel specification */
	command |= channel << 2;
+1 −1
Original line number Diff line number Diff line
@@ -264,7 +264,7 @@ static int cb_pcimdas_attach(struct comedi_device *dev,
	default:
		printk("THIS CARD IS UNSUPPORTED.\n"
		       "PLEASE REPORT USAGE TO <mocelet@sucs.org>\n");
	};
	}

	if (comedi_pci_enable(pcidev, "cb_pcimdas")) {
		printk(" Failed to enable PCI device and request regions\n");
+1 −1
Original line number Diff line number Diff line
@@ -1418,7 +1418,7 @@ static int ni_660x_dio_insn_config(struct comedi_device *dev,
	default:
		return -EINVAL;
		break;
	};
	}
	return 0;
}

Loading