diff options
author | Joe Perches <joe@perches.com> | 2011-04-10 14:31:35 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-04-25 16:58:35 -0700 |
commit | 95cd17c9f3734091a5811fabbd778e3f7b1f0789 (patch) | |
tree | 3c45e4755a8d889cd9dbb4a0852d28605a4bb5b2 /drivers/staging/comedi | |
parent | 273f4bef1847ef69f30d7e55f8de876a92639f17 (diff) | |
download | linux-3.10-95cd17c9f3734091a5811fabbd778e3f7b1f0789.tar.gz linux-3.10-95cd17c9f3734091a5811fabbd778e3f7b1f0789.tar.bz2 linux-3.10-95cd17c9f3734091a5811fabbd778e3f7b1f0789.zip |
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>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r-- | drivers/staging/comedi/drivers/adl_pci9118.c | 4 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/cb_pcidda.c | 2 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/cb_pcimdas.c | 2 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/ni_660x.c | 2 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/ni_mio_common.c | 6 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/ni_tio.c | 6 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/pcl818.c | 2 |
7 files changed, 12 insertions, 12 deletions
diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c b/drivers/staging/comedi/drivers/adl_pci9118.c index 632d5d0721c..08b71d9974b 100644 --- a/drivers/staging/comedi/drivers/adl_pci9118.c +++ b/drivers/staging/comedi/drivers/adl_pci9118.c @@ -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); diff --git a/drivers/staging/comedi/drivers/cb_pcidda.c b/drivers/staging/comedi/drivers/cb_pcidda.c index 6383fc93b83..49102b3a6c4 100644 --- a/drivers/staging/comedi/drivers/cb_pcidda.c +++ b/drivers/staging/comedi/drivers/cb_pcidda.c @@ -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; diff --git a/drivers/staging/comedi/drivers/cb_pcimdas.c b/drivers/staging/comedi/drivers/cb_pcimdas.c index 3d53df000cf..b1b832b65bc 100644 --- a/drivers/staging/comedi/drivers/cb_pcimdas.c +++ b/drivers/staging/comedi/drivers/cb_pcimdas.c @@ -264,7 +264,7 @@ found: 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"); diff --git a/drivers/staging/comedi/drivers/ni_660x.c b/drivers/staging/comedi/drivers/ni_660x.c index ca2aeaa9449..35f3a474982 100644 --- a/drivers/staging/comedi/drivers/ni_660x.c +++ b/drivers/staging/comedi/drivers/ni_660x.c @@ -1418,7 +1418,7 @@ static int ni_660x_dio_insn_config(struct comedi_device *dev, default: return -EINVAL; break; - }; + } return 0; } diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c index 986ef671298..fd232bc5f87 100644 --- a/drivers/staging/comedi/drivers/ni_mio_common.c +++ b/drivers/staging/comedi/drivers/ni_mio_common.c @@ -1627,7 +1627,7 @@ static int ni_ai_setup_MITE_dma(struct comedi_device *dev) default: mite_prep_dma(devpriv->ai_mite_chan, 16, 16); break; - }; + } /*start the MITE */ mite_dma_arm(devpriv->ai_mite_chan); spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags); @@ -2156,7 +2156,7 @@ static unsigned ni_min_ai_scan_period_ns(struct comedi_device *dev, default: /* multiplexed inputs */ break; - }; + } return boardtype.ai_speed * num_channels; } @@ -5173,7 +5173,7 @@ static void GPCT_Reset(struct comedi_device *dev, int chan) devpriv->stc_writew(dev, devpriv->an_trig_etc_reg, Analog_Trigger_Etc_Register); break; - }; + } devpriv->gpct_mode[chan] = 0; devpriv->gpct_input_select[chan] = 0; diff --git a/drivers/staging/comedi/drivers/ni_tio.c b/drivers/staging/comedi/drivers/ni_tio.c index a9bb6b13dfc..98f87897e2a 100644 --- a/drivers/staging/comedi/drivers/ni_tio.c +++ b/drivers/staging/comedi/drivers/ni_tio.c @@ -1181,7 +1181,7 @@ static int ni_660x_set_second_gate(struct ni_gpct *counter, break; return -EINVAL; break; - }; + } counter_dev->regs[second_gate_reg] |= Gi_Second_Gate_Mode_Bit; counter_dev->regs[second_gate_reg] &= ~Gi_Second_Gate_Select_Mask; counter_dev->regs[second_gate_reg] |= @@ -1209,7 +1209,7 @@ static int ni_m_series_set_second_gate(struct ni_gpct *counter, ni_m_series_second_gate_select = selected_second_gate & selected_second_gate_mask; break; - }; + } counter_dev->regs[second_gate_reg] |= Gi_Second_Gate_Mode_Bit; counter_dev->regs[second_gate_reg] &= ~Gi_Second_Gate_Select_Mask; counter_dev->regs[second_gate_reg] |= @@ -1674,7 +1674,7 @@ int ni_tio_rinsn(struct ni_gpct *counter, struct comedi_insn *insn, counter_dev-> regs[NITIO_Gi_LoadB_Reg(counter->counter_index)]; break; - }; + } return 0; } EXPORT_SYMBOL_GPL(ni_tio_rinsn); diff --git a/drivers/staging/comedi/drivers/pcl818.c b/drivers/staging/comedi/drivers/pcl818.c index e3eea09ae1f..8933e5089bd 100644 --- a/drivers/staging/comedi/drivers/pcl818.c +++ b/drivers/staging/comedi/drivers/pcl818.c @@ -1662,7 +1662,7 @@ static void rtc_dropped_irq(unsigned long data) tmp = (CMOS_READ(RTC_INTR_FLAGS) & 0xF0); /* restart */ restore_flags(flags); break; - }; + } } /* |