]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
staging: Remove unnecessary semicolons when for (foo) {...};
authorJoe Perches <joe@perches.com>
Sun, 10 Apr 2011 21:31:34 +0000 (14:31 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 25 Apr 2011 23:58:35 +0000 (16:58 -0700)
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>
drivers/staging/comedi/drivers/pcl724.c
drivers/staging/comedi/drivers/pcm3724.c
drivers/staging/vt6655/ioctl.c
drivers/staging/vt6655/wmgr.c
drivers/staging/vt6655/wpactl.c
drivers/staging/vt6656/ioctl.c
drivers/staging/vt6656/wmgr.c
drivers/staging/vt6656/wpactl.c
drivers/staging/westbridge/astoria/arch/arm/mach-omap2/cyashalomap_kernel.c

index 396a058bb67dc242721408498dd2734370e145a6..61b075db66ef425e65b99456c427429b783bdc5e 100644 (file)
@@ -209,7 +209,7 @@ static int pcl724_attach(struct comedi_device *dev, struct comedi_devconfig *it)
                                         subdev_8255_cb,
                                         (unsigned long)(dev->iobase +
                                                         SIZE_8255 * i));
-       };
+       }
 
        return 0;
 }
index 7fb3c27e5979ce1b42eaf7e1a166aa95ed4b0a48..f5c0bd17684c4d16092af720f75f8883efa96583 100644 (file)
@@ -301,7 +301,7 @@ static int pcm3724_attach(struct comedi_device *dev,
                subdev_8255_init(dev, dev->subdevices + i, subdev_8255_cb,
                                 (unsigned long)(dev->iobase + SIZE_8255 * i));
                ((dev->subdevices) + i)->insn_config = subdev_3724_insn_config;
-       };
+       }
        return 0;
 }
 
index a74833d0eeabe7a1685f2e5fa14fdbffab24b470..8cf88c3b68da3ab46129dee4e24b656a67033e09 100644 (file)
@@ -312,7 +312,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;
@@ -606,7 +606,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))) {
@@ -657,7 +657,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;
index 71f7726e5ed05e2598aa8250de0b694e550d99b6..ab289c30edb4f085a0bdab2a9512c373dc300267 100644 (file)
@@ -3179,7 +3179,7 @@ s_vMgrFormatTIM(
             }
             wEndIndex = ii;
         }
-    };
+    }
 
 
     // Round start index down to nearest even number
index 78e326c8379a8491ad5a39d8fe7b3d576dc73169..c328f95d6a3617efea0e416b1943a379a3a8cc02 100644 (file)
@@ -653,7 +653,7 @@ static int wpa_get_scan(PSDevice pDevice,
 
          }
 
-    };
+    }
 
   kfree(ptempBSS);
 
@@ -679,7 +679,7 @@ static int wpa_get_scan(PSDevice pDevice,
         if (!pBSS->bActive)
             continue;
         count++;
-    };
+    }
 
     pBuf = kcalloc(count, sizeof(struct viawget_scan_result), (int)GFP_ATOMIC);
 
index 12be31614ae4c7d2a875809a765638baed283bbe..cfe9c95d78074a076d80c1560751a1575fd65512 100644 (file)
@@ -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;
index 938e582189d9800f49b52f1edd679599d2f2f8ee..d67748f90b14b7b41b42dea61ac6ac1439b6adba 100644 (file)
@@ -3167,7 +3167,7 @@ s_vMgrFormatTIM(
             }
             wEndIndex = (WORD)ii;
         }
-    };
+    }
 
 
     // Round start index down to nearest even number
index dabcb6e190235036a4438a99434ca7fd8851b2e6..d22e773333dda9abe6e23c9b49a09d600ca98d42 100644 (file)
@@ -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);
 
index 3bcedce13f4ae25c369a9ac6014587f869cb763d..dd4cd412aeb57c64da97be464fb82f66879c3474 100644 (file)
@@ -768,7 +768,7 @@ uint32_t cy_as_hal_processor_hw_init(void)
                cy_as_hal_print_message(KERN_INFO "%s virt_addr=%x\n",
                                        gpio_vma_tab[i].name,
                                        (u32)gpio_vma_tab[i].virt_addr);
-       };
+       }
 
        /*
         * force OMAP_GPIO_126  to rleased state,