diff options
author | Joe Perches <joe@perches.com> | 2011-04-10 21:31:34 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-04-25 23:58:35 (GMT) |
commit | 273f4bef1847ef69f30d7e55f8de876a92639f17 (patch) | |
tree | c70e02b2f823a2ece3b4ac4433ee3a648fa70849 /drivers/staging/vt6656 | |
parent | b0b0fb0fd519c7597d6bf4de7be660788cf2232c (diff) | |
download | linux-273f4bef1847ef69f30d7e55f8de876a92639f17.tar.xz |
staging: Remove unnecessary semicolons when for (foo) {...};
Done via perl script:
$ cat remove_semi_for.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(for\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/vt6656')
-rw-r--r-- | drivers/staging/vt6656/ioctl.c | 6 | ||||
-rw-r--r-- | drivers/staging/vt6656/wmgr.c | 2 | ||||
-rw-r--r-- | drivers/staging/vt6656/wpactl.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/drivers/staging/vt6656/ioctl.c b/drivers/staging/vt6656/ioctl.c index 12be316..cfe9c95 100644 --- a/drivers/staging/vt6656/ioctl.c +++ b/drivers/staging/vt6656/ioctl.c @@ -307,7 +307,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) { if (!pBSS->bActive) continue; cbListCount++; - }; + } sList.uItem = cbListCount; if (copy_to_user(pReq->data, &sList, sizeof(SBSSIDList))) { result = -EFAULT; @@ -594,7 +594,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) { if (!pNode->bActive) continue; cbListCount++; - }; + } sNodeList.uItem = cbListCount; if (copy_to_user(pReq->data, &sNodeList, sizeof(SNodeList))) { @@ -645,7 +645,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) { if (jj >= pNodeList->uItem) break; } - }; + } if (copy_to_user(pReq->data, pNodeList, sizeof(SNodeList) + (sNodeList.uItem * sizeof(SNodeItem)))) { result = -EFAULT; break; diff --git a/drivers/staging/vt6656/wmgr.c b/drivers/staging/vt6656/wmgr.c index 938e582..d67748f 100644 --- a/drivers/staging/vt6656/wmgr.c +++ b/drivers/staging/vt6656/wmgr.c @@ -3167,7 +3167,7 @@ s_vMgrFormatTIM( } wEndIndex = (WORD)ii; } - }; + } // Round start index down to nearest even number diff --git a/drivers/staging/vt6656/wpactl.c b/drivers/staging/vt6656/wpactl.c index dabcb6e..d22e773 100644 --- a/drivers/staging/vt6656/wpactl.c +++ b/drivers/staging/vt6656/wpactl.c @@ -660,7 +660,7 @@ static int wpa_get_scan(PSDevice pDevice, } - }; + } kfree(ptempBSS); @@ -673,7 +673,7 @@ static int wpa_get_scan(PSDevice pDevice, if (!pBSS->bActive) continue; count++; - }; + } pBuf = kcalloc(count, sizeof(struct viawget_scan_result), (int)GFP_ATOMIC); |