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

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
...@@ -4230,7 +4230,7 @@ ar6000_connect_event(struct ar6_softc *ar, u16 channel, u8 *bssid, ...@@ -4230,7 +4230,7 @@ ar6000_connect_event(struct ar6_softc *ar, u16 channel, u8 *bssid,
default: default:
A_PRINTF("AUTH: Unknown\n"); A_PRINTF("AUTH: Unknown\n");
break; break;
}; }
switch (listenInterval&0xFF) { switch (listenInterval&0xFF) {
case WPA_PSK_AUTH: case WPA_PSK_AUTH:
A_PRINTF("KeyMgmt: WPA-PSK\n"); A_PRINTF("KeyMgmt: WPA-PSK\n");
...@@ -4241,7 +4241,7 @@ ar6000_connect_event(struct ar6_softc *ar, u16 channel, u8 *bssid, ...@@ -4241,7 +4241,7 @@ ar6000_connect_event(struct ar6_softc *ar, u16 channel, u8 *bssid,
default: default:
A_PRINTF("KeyMgmt: NONE\n"); A_PRINTF("KeyMgmt: NONE\n");
break; break;
}; }
switch (beaconInterval) { switch (beaconInterval) {
case AES_CRYPT: case AES_CRYPT:
A_PRINTF("Cipher: AES\n"); A_PRINTF("Cipher: AES\n");
...@@ -4260,7 +4260,7 @@ ar6000_connect_event(struct ar6_softc *ar, u16 channel, u8 *bssid, ...@@ -4260,7 +4260,7 @@ ar6000_connect_event(struct ar6_softc *ar, u16 channel, u8 *bssid,
default: default:
A_PRINTF("Cipher: NONE\n"); A_PRINTF("Cipher: NONE\n");
break; break;
}; }
add_new_sta(ar, bssid, channel /*aid*/, add_new_sta(ar, bssid, channel /*aid*/,
assocInfo /* WPA IE */, assocRespLen /* IE len */, assocInfo /* WPA IE */, assocRespLen /* IE len */,
......
...@@ -1417,7 +1417,7 @@ static int pci9118_ai_docmd_sampl(struct comedi_device *dev, ...@@ -1417,7 +1417,7 @@ static int pci9118_ai_docmd_sampl(struct comedi_device *dev,
comedi_error(dev, comedi_error(dev,
"pci9118_ai_docmd_sampl() mode number bug!\n"); "pci9118_ai_docmd_sampl() mode number bug!\n");
return -EIO; return -EIO;
}; }
devpriv->int_ai_func = interrupt_pci9118_ai_onesample; devpriv->int_ai_func = interrupt_pci9118_ai_onesample;
/* transfer function */ /* transfer function */
...@@ -1496,7 +1496,7 @@ static int pci9118_ai_docmd_dma(struct comedi_device *dev, ...@@ -1496,7 +1496,7 @@ static int pci9118_ai_docmd_dma(struct comedi_device *dev,
default: default:
comedi_error(dev, "pci9118_ai_docmd_dma() mode number bug!\n"); comedi_error(dev, "pci9118_ai_docmd_dma() mode number bug!\n");
return -EIO; return -EIO;
}; }
if (devpriv->ai12_startstop) { if (devpriv->ai12_startstop) {
pci9118_exttrg_add(dev, EXTTRG_AI); pci9118_exttrg_add(dev, EXTTRG_AI);
......
...@@ -650,7 +650,7 @@ static int cb_pcidda_ao_winsn(struct comedi_device *dev, ...@@ -650,7 +650,7 @@ static int cb_pcidda_ao_winsn(struct comedi_device *dev,
case 5: case 5:
command |= UNIP | RANGE2V5; command |= UNIP | RANGE2V5;
break; break;
}; }
/* output channel specification */ /* output channel specification */
command |= channel << 2; command |= channel << 2;
......
...@@ -264,7 +264,7 @@ static int cb_pcimdas_attach(struct comedi_device *dev, ...@@ -264,7 +264,7 @@ static int cb_pcimdas_attach(struct comedi_device *dev,
default: default:
printk("THIS CARD IS UNSUPPORTED.\n" printk("THIS CARD IS UNSUPPORTED.\n"
"PLEASE REPORT USAGE TO <mocelet@sucs.org>\n"); "PLEASE REPORT USAGE TO <mocelet@sucs.org>\n");
}; }
if (comedi_pci_enable(pcidev, "cb_pcimdas")) { if (comedi_pci_enable(pcidev, "cb_pcimdas")) {
printk(" Failed to enable PCI device and request regions\n"); printk(" Failed to enable PCI device and request regions\n");
......
...@@ -1418,7 +1418,7 @@ static int ni_660x_dio_insn_config(struct comedi_device *dev, ...@@ -1418,7 +1418,7 @@ static int ni_660x_dio_insn_config(struct comedi_device *dev,
default: default:
return -EINVAL; return -EINVAL;
break; break;
}; }
return 0; return 0;
} }
......
...@@ -1627,7 +1627,7 @@ static int ni_ai_setup_MITE_dma(struct comedi_device *dev) ...@@ -1627,7 +1627,7 @@ static int ni_ai_setup_MITE_dma(struct comedi_device *dev)
default: default:
mite_prep_dma(devpriv->ai_mite_chan, 16, 16); mite_prep_dma(devpriv->ai_mite_chan, 16, 16);
break; break;
}; }
/*start the MITE */ /*start the MITE */
mite_dma_arm(devpriv->ai_mite_chan); mite_dma_arm(devpriv->ai_mite_chan);
spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags); spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags);
...@@ -2156,7 +2156,7 @@ static unsigned ni_min_ai_scan_period_ns(struct comedi_device *dev, ...@@ -2156,7 +2156,7 @@ static unsigned ni_min_ai_scan_period_ns(struct comedi_device *dev,
default: default:
/* multiplexed inputs */ /* multiplexed inputs */
break; break;
}; }
return boardtype.ai_speed * num_channels; return boardtype.ai_speed * num_channels;
} }
...@@ -5173,7 +5173,7 @@ static void GPCT_Reset(struct comedi_device *dev, int chan) ...@@ -5173,7 +5173,7 @@ static void GPCT_Reset(struct comedi_device *dev, int chan)
devpriv->stc_writew(dev, devpriv->an_trig_etc_reg, devpriv->stc_writew(dev, devpriv->an_trig_etc_reg,
Analog_Trigger_Etc_Register); Analog_Trigger_Etc_Register);
break; break;
}; }
devpriv->gpct_mode[chan] = 0; devpriv->gpct_mode[chan] = 0;
devpriv->gpct_input_select[chan] = 0; devpriv->gpct_input_select[chan] = 0;
......
...@@ -1181,7 +1181,7 @@ static int ni_660x_set_second_gate(struct ni_gpct *counter, ...@@ -1181,7 +1181,7 @@ static int ni_660x_set_second_gate(struct ni_gpct *counter,
break; break;
return -EINVAL; return -EINVAL;
break; break;
}; }
counter_dev->regs[second_gate_reg] |= Gi_Second_Gate_Mode_Bit; 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] &= ~Gi_Second_Gate_Select_Mask;
counter_dev->regs[second_gate_reg] |= counter_dev->regs[second_gate_reg] |=
...@@ -1209,7 +1209,7 @@ static int ni_m_series_set_second_gate(struct ni_gpct *counter, ...@@ -1209,7 +1209,7 @@ static int ni_m_series_set_second_gate(struct ni_gpct *counter,
ni_m_series_second_gate_select = ni_m_series_second_gate_select =
selected_second_gate & selected_second_gate_mask; selected_second_gate & selected_second_gate_mask;
break; break;
}; }
counter_dev->regs[second_gate_reg] |= Gi_Second_Gate_Mode_Bit; 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] &= ~Gi_Second_Gate_Select_Mask;
counter_dev->regs[second_gate_reg] |= counter_dev->regs[second_gate_reg] |=
...@@ -1674,7 +1674,7 @@ int ni_tio_rinsn(struct ni_gpct *counter, struct comedi_insn *insn, ...@@ -1674,7 +1674,7 @@ int ni_tio_rinsn(struct ni_gpct *counter, struct comedi_insn *insn,
counter_dev-> counter_dev->
regs[NITIO_Gi_LoadB_Reg(counter->counter_index)]; regs[NITIO_Gi_LoadB_Reg(counter->counter_index)];
break; break;
}; }
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(ni_tio_rinsn); EXPORT_SYMBOL_GPL(ni_tio_rinsn);
......
...@@ -1662,7 +1662,7 @@ static void rtc_dropped_irq(unsigned long data) ...@@ -1662,7 +1662,7 @@ static void rtc_dropped_irq(unsigned long data)
tmp = (CMOS_READ(RTC_INTR_FLAGS) & 0xF0); /* restart */ tmp = (CMOS_READ(RTC_INTR_FLAGS) & 0xF0); /* restart */
restore_flags(flags); restore_flags(flags);
break; break;
}; }
} }
/* /*
......
...@@ -311,7 +311,7 @@ enum BC_STATUS crystalhd_pci_cfg_rd(struct crystalhd_adp *adp, uint32_t off, ...@@ -311,7 +311,7 @@ enum BC_STATUS crystalhd_pci_cfg_rd(struct crystalhd_adp *adp, uint32_t off,
rc = -EINVAL; rc = -EINVAL;
sts = BC_STS_INV_ARG; sts = BC_STS_INV_ARG;
BCMLOG_ERR("Invalid len:%d\n", len); BCMLOG_ERR("Invalid len:%d\n", len);
}; }
if (rc && (sts == BC_STS_SUCCESS)) if (rc && (sts == BC_STS_SUCCESS))
sts = BC_STS_ERROR; sts = BC_STS_ERROR;
...@@ -356,7 +356,7 @@ enum BC_STATUS crystalhd_pci_cfg_wr(struct crystalhd_adp *adp, uint32_t off, ...@@ -356,7 +356,7 @@ enum BC_STATUS crystalhd_pci_cfg_wr(struct crystalhd_adp *adp, uint32_t off,
rc = -EINVAL; rc = -EINVAL;
sts = BC_STS_INV_ARG; sts = BC_STS_INV_ARG;
BCMLOG_ERR("Invalid len:%d\n", len); BCMLOG_ERR("Invalid len:%d\n", len);
}; }
if (rc && (sts == BC_STS_SUCCESS)) if (rc && (sts == BC_STS_SUCCESS))
sts = BC_STS_ERROR; sts = BC_STS_ERROR;
......
...@@ -1574,7 +1574,7 @@ int cx25821_set_control(struct cx25821_dev *dev, ...@@ -1574,7 +1574,7 @@ int cx25821_set_control(struct cx25821_dev *dev,
break; break;
default: default:
/* nothing */ ; /* nothing */ ;
}; }
switch (ctl->id) { switch (ctl->id) {
case V4L2_CID_BRIGHTNESS: case V4L2_CID_BRIGHTNESS:
......
...@@ -88,7 +88,7 @@ static void shutdown_onchannelcallback(void *context) ...@@ -88,7 +88,7 @@ static void shutdown_onchannelcallback(void *context)
pr_info("Shutdown request received -" pr_info("Shutdown request received -"
" Invalid request\n"); " Invalid request\n");
break; break;
}; }
} }
icmsghdrp->icflags = ICMSGHDRFLAG_TRANSACTION icmsghdrp->icflags = ICMSGHDRFLAG_TRANSACTION
......
...@@ -399,7 +399,7 @@ static ssize_t lis3l02dq_write_frequency(struct device *dev, ...@@ -399,7 +399,7 @@ static ssize_t lis3l02dq_write_frequency(struct device *dev,
default: default:
ret = -EINVAL; ret = -EINVAL;
goto error_ret_mutex; goto error_ret_mutex;
}; }
ret = lis3l02dq_spi_write_reg_8(dev, ret = lis3l02dq_spi_write_reg_8(dev,
LIS3L02DQ_REG_CTRL_1_ADDR, LIS3L02DQ_REG_CTRL_1_ADDR,
......
...@@ -403,7 +403,7 @@ static ssize_t adt7316_show_ad_channel(struct device *dev, ...@@ -403,7 +403,7 @@ static ssize_t adt7316_show_ad_channel(struct device *dev,
return sprintf(buf, "5 - AIN4\n"); return sprintf(buf, "5 - AIN4\n");
default: default:
return sprintf(buf, "N/A\n"); return sprintf(buf, "N/A\n");
}; }
} }
static ssize_t adt7316_store_ad_channel(struct device *dev, static ssize_t adt7316_store_ad_channel(struct device *dev,
...@@ -893,7 +893,7 @@ static ssize_t adt7316_show_DAC_update_mode(struct device *dev, ...@@ -893,7 +893,7 @@ static ssize_t adt7316_show_DAC_update_mode(struct device *dev,
return sprintf(buf, "2 - auto at MSB DAC ABCD writing\n"); return sprintf(buf, "2 - auto at MSB DAC ABCD writing\n");
default: /* ADT7316_DA_EN_MODE_LDAC */ default: /* ADT7316_DA_EN_MODE_LDAC */
return sprintf(buf, "3 - manual\n"); return sprintf(buf, "3 - manual\n");
}; }
} }
} }
...@@ -1205,7 +1205,7 @@ static ssize_t adt7316_show_ad(struct adt7316_chip_info *chip, ...@@ -1205,7 +1205,7 @@ static ssize_t adt7316_show_ad(struct adt7316_chip_info *chip,
return sprintf(buf, "%d\n", data); return sprintf(buf, "%d\n", data);
else else
break; break;
}; }
if (data & ADT7316_T_VALUE_SIGN) { if (data & ADT7316_T_VALUE_SIGN) {
/* convert supplement to positive value */ /* convert supplement to positive value */
......
...@@ -919,7 +919,7 @@ static int set_use_inc(void *data) ...@@ -919,7 +919,7 @@ static int set_use_inc(void *data)
default: default:
dprintk("Interrupt %d, port %04x obtained\n", irq, io); dprintk("Interrupt %d, port %04x obtained\n", irq, io);
break; break;
}; }
spin_lock_irqsave(&hardware[type].lock, flags); spin_lock_irqsave(&hardware[type].lock, flags);
......
...@@ -832,7 +832,7 @@ else ...@@ -832,7 +832,7 @@ else
break; break;
default: default:
pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled; pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled;
}; }
//DavidWang add for WPA_supplicant support open/share mode //DavidWang add for WPA_supplicant support open/share mode
......
...@@ -831,7 +831,7 @@ static int wpa_set_associate(PSDevice pDevice, ...@@ -831,7 +831,7 @@ static int wpa_set_associate(PSDevice pDevice,
break; break;
default: default:
pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled; pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled;
}; }
pMgmt->Roam_dbm = param->u.wpa_associate.roam_dbm; pMgmt->Roam_dbm = param->u.wpa_associate.roam_dbm;
// if ((pMgmt->Roam_dbm > 40)&&(pMgmt->Roam_dbm<80)) // if ((pMgmt->Roam_dbm > 40)&&(pMgmt->Roam_dbm<80))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment