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/iio/addac | |
parent | 273f4bef1847ef69f30d7e55f8de876a92639f17 (diff) |
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/iio/addac')
-rw-r--r-- | drivers/staging/iio/addac/adt7316.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/iio/addac/adt7316.c b/drivers/staging/iio/addac/adt7316.c index d1b5b13629d..9b25f120544 100644 --- a/drivers/staging/iio/addac/adt7316.c +++ b/drivers/staging/iio/addac/adt7316.c @@ -403,7 +403,7 @@ static ssize_t adt7316_show_ad_channel(struct device *dev, return sprintf(buf, "5 - AIN4\n"); default: return sprintf(buf, "N/A\n"); - }; + } } 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, return sprintf(buf, "2 - auto at MSB DAC ABCD writing\n"); default: /* ADT7316_DA_EN_MODE_LDAC */ return sprintf(buf, "3 - manual\n"); - }; + } } } @@ -1205,7 +1205,7 @@ static ssize_t adt7316_show_ad(struct adt7316_chip_info *chip, return sprintf(buf, "%d\n", data); else break; - }; + } if (data & ADT7316_T_VALUE_SIGN) { /* convert supplement to positive value */ |