Skip to content

Commit

Permalink
staging: Remove unnecessary semicolons when if (foo) {...};
Browse files Browse the repository at this point in the history
Done via perl script:

$ cat remove_semi_if.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(if\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>
  • Loading branch information
Joe Perches authored and Greg Kroah-Hartman committed Apr 25, 2011
1 parent 60b0fa1 commit 9fc8602
Show file tree
Hide file tree
Showing 18 changed files with 131 additions and 131 deletions.
2 changes: 1 addition & 1 deletion drivers/staging/intel_sst/intel_sst_pvt.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ int sst_create_large_msg(struct ipc_post **arg)
kfree(msg);
pr_err("kzalloc mailbox_data failed");
return -ENOMEM;
};
}
*arg = msg;
return 0;
}
Expand Down
8 changes: 4 additions & 4 deletions drivers/staging/vt6655/bssdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,7 @@ CARDbRadioPowerOn(pDevice);
memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb));
netif_rx(pDevice->skb);
pDevice->skb = dev_alloc_skb((int)pDevice->rx_buf_sz);
};
}
#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
// if(pDevice->bWPASuppWextEnabled == true)
{
Expand Down Expand Up @@ -1489,7 +1489,7 @@ BSSvUpdateNodeTxCounter(
}
}
}
};
}

if ((pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) ||
(pMgmt->eCurrMode == WMAC_MODE_ESS_AP)) {
Expand Down Expand Up @@ -1543,9 +1543,9 @@ BSSvUpdateNodeTxCounter(
}
}
}
};
}
}
};
}

return;

Expand Down
14 changes: 7 additions & 7 deletions drivers/staging/vt6655/device_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ static bool device_release_WPADEV(PSDevice pDevice)
if(ii>20)
break;
}
};
}
return true;
}

Expand Down Expand Up @@ -1446,7 +1446,7 @@ static void device_init_defrag_cb(PSDevice pDevice) {
if (!device_alloc_frag_buf(pDevice, pDeF)) {
DBG_PRT(MSG_LEVEL_ERR,KERN_ERR "%s: can not alloc frag bufs\n",
pDevice->dev->name);
};
}
}
pDevice->cbDFCB = CB_MAX_RX_FRAG;
pDevice->cbFreeDFCB = pDevice->cbDFCB;
Expand Down Expand Up @@ -2104,7 +2104,7 @@ static int device_dma0_tx_80211(struct sk_buff *skb, struct net_device *dev) {
dev_kfree_skb_irq(skb);
spin_unlock_irq(&pDevice->lock);
return 0;
};
}

cbMPDULen = skb->len;
pbMPDU = skb->data;
Expand Down Expand Up @@ -2136,7 +2136,7 @@ bool device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, unsigned int uNodeI
if (pDevice->bStopTx0Pkt == true) {
dev_kfree_skb_irq(skb);
return false;
};
}

if (AVAIL_TD(pDevice, TYPE_TXDMA0) <= 0) {
dev_kfree_skb_irq(skb);
Expand Down Expand Up @@ -2865,7 +2865,7 @@ static irqreturn_t device_intr(int irq, void *dev_instance) {
pDevice->bBeaconSent = false;
if (pDevice->bEnablePSMode) {
PSbIsNextTBTTWakeUp((void *)pDevice);
};
}

if ((pDevice->eOPMode == OP_MODE_AP) ||
(pDevice->eOPMode == OP_MODE_ADHOC)) {
Expand All @@ -2876,7 +2876,7 @@ static irqreturn_t device_intr(int irq, void *dev_instance) {

if (pDevice->eOPMode == OP_MODE_ADHOC && pDevice->pMgmt->wCurrATIMWindow > 0) {
// todo adhoc PS mode
};
}

}

Expand All @@ -2885,7 +2885,7 @@ static irqreturn_t device_intr(int irq, void *dev_instance) {
if (pDevice->eOPMode == OP_MODE_ADHOC) {
pDevice->bIsBeaconBufReadySet = false;
pDevice->cbBeaconBufReadySetCnt = 0;
};
}

if (pDevice->eOPMode == OP_MODE_AP) {
if(pMgmt->byDTIMCount > 0) {
Expand Down
10 changes: 5 additions & 5 deletions drivers/staging/vt6655/dpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ device_receive_frame (
pDevice->pMgmt->bInTIMWake = false;
}
}
};
}

// Now it only supports 802.11g Infrastructure Mode, and support rate must up to 54 Mbps
if (pDevice->bDiversityEnable && (FrameSize>50) &&
Expand Down Expand Up @@ -884,7 +884,7 @@ device_receive_frame (
memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb));
netif_rx(pDevice->skb);
pDevice->skb = dev_alloc_skb((int)pDevice->rx_buf_sz);
};
}

return false;

Expand Down Expand Up @@ -1049,7 +1049,7 @@ static bool s_bAPModeRxCtl (
);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "dpc: send vMgrDeAuthenBeginSta 1\n");
return true;
};
}
if (pMgmt->sNodeDBTable[iSANodeIndex].eNodeState < NODE_ASSOC) {
// send deassoc notification
// reason = (7) class 3 received from nonassoc sta
Expand All @@ -1061,7 +1061,7 @@ static bool s_bAPModeRxCtl (
);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "dpc: send vMgrDisassocBeginSta 2\n");
return true;
};
}

if (pMgmt->sNodeDBTable[iSANodeIndex].bPSEnable) {
// delcare received ps-poll event
Expand Down Expand Up @@ -1486,7 +1486,7 @@ static bool s_bAPModeRxData (
bRelayOnly = true;
}
}
};
}
}

if (bRelayOnly || bRelayAndForward) {
Expand Down
38 changes: 19 additions & 19 deletions drivers/staging/vt6655/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
if (copy_from_user(&sScanCmd, pReq->data, sizeof(SCmdScan))) {
result = -EFAULT;
break;
};
}

pItemSSID = (PWLAN_IE_SSID)sScanCmd.ssid;
if (pItemSSID->len != 0) {
Expand Down Expand Up @@ -128,7 +128,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
if (copy_from_user(&sZoneTypeCmd, pReq->data, sizeof(SCmdZoneTypeSet))) {
result = -EFAULT;
break;
};
}

if(sZoneTypeCmd.bWrite==true) {
//////write zonetype
Expand Down Expand Up @@ -167,7 +167,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
if (copy_to_user(pReq->data, &sZoneTypeCmd, sizeof(SCmdZoneTypeSet))) {
result = -EFAULT;
break;
};
}
}

break;
Expand All @@ -186,7 +186,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
if (copy_from_user(&sJoinCmd, pReq->data, sizeof(SCmdBSSJoin))) {
result = -EFAULT;
break;
};
}

pItemSSID = (PWLAN_IE_SSID)sJoinCmd.ssid;
memset(pMgmt->abyDesireSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
Expand Down Expand Up @@ -234,7 +234,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
if (copy_from_user(&sWEPCmd, pReq->data, sizeof(SCmdSetWEP))) {
result = -EFAULT;
break;
};
}
if (sWEPCmd.bEnableWep != true) {
pDevice->bEncryptionEnable = false;
pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled;
Expand Down Expand Up @@ -300,7 +300,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
if (copy_to_user(pReq->data, &sLinkStatus, sizeof(SCmdLinkStatus))) {
result = -EFAULT;
break;
};
}

break;

Expand All @@ -317,15 +317,15 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
if (copy_to_user(pReq->data, &sList, sizeof(SBSSIDList))) {
result = -EFAULT;
break;
};
}
pReq->wResult = 0;
break;

case WLAN_CMD_GET_LIST:
if (copy_from_user(&sList, pReq->data, sizeof(SBSSIDList))) {
result = -EFAULT;
break;
};
}
pList = (PSBSSIDList)kmalloc(sizeof(SBSSIDList) + (sList.uItem * sizeof(SBSSIDItem)), (int)GFP_ATOMIC);
if (pList == NULL) {
result = -ENOMEM;
Expand Down Expand Up @@ -367,7 +367,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
if (copy_to_user(pReq->data, pList, sizeof(SBSSIDList) + (sList.uItem * sizeof(SBSSIDItem)))) {
result = -EFAULT;
break;
};
}
kfree(pList);
pReq->wResult = 0;
break;
Expand All @@ -376,14 +376,14 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
if (copy_to_user(pReq->data, &(pDevice->s802_11Counter), sizeof(SDot11MIBCount))) {
result = -EFAULT;
break;
};
}
break;

case WLAN_CMD_GET_STAT:
if (copy_to_user(pReq->data, &(pDevice->scStatistic), sizeof(SStatCounter))) {
result = -EFAULT;
break;
};
}
break;
case WLAN_CMD_STOP_MAC:

Expand Down Expand Up @@ -427,7 +427,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
if (copy_from_user(&sValue, pReq->data, sizeof(SCmdValue))) {
result = -EFAULT;
break;
};
}
if (sValue.dwValue == 1) {
if (vt6655_hostap_set_hostapd(pDevice, 1, 1) == 0){
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Enable HOSTAP\n");
Expand Down Expand Up @@ -455,7 +455,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
if (copy_from_user(&sValue, pReq->data, sizeof(SCmdValue))) {
result = -EFAULT;
break;
};
}

if (sValue.dwValue == 1) {
pDevice->bEnable8021x = true;
Expand All @@ -475,7 +475,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
if (copy_from_user(&sValue, pReq->data, sizeof(SCmdValue))) {
result = -EFAULT;
break;
};
}

if (sValue.dwValue == 1) {
pDevice->bEnableHostWEP = true;
Expand All @@ -494,7 +494,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
if (copy_from_user(&sValue, pReq->data, sizeof(SCmdValue))) {
result = -EFAULT;
break;
};
}
if (sValue.dwValue == 1) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "up wpadev\n");
memcpy(pDevice->wpadev->dev_addr, pDevice->dev->dev_addr, ETH_ALEN);
Expand All @@ -519,7 +519,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
if (copy_from_user(&sStartAPCmd, pReq->data, sizeof(SCmdStartAP))) {
result = -EFAULT;
break;
};
}

if (sStartAPCmd.wBSSType == AP) {
pMgmt->eConfigMode = WMAC_CONFIG_AP;
Expand Down Expand Up @@ -612,7 +612,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
if (copy_to_user(pReq->data, &sNodeList, sizeof(SNodeList))) {
result = -EFAULT;
break;
};
}
pReq->wResult = 0;
break;

Expand All @@ -621,7 +621,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
if (copy_from_user(&sNodeList, pReq->data, sizeof(SNodeList))) {
result = -EFAULT;
break;
};
}
pNodeList = (PSNodeList)kmalloc(sizeof(SNodeList) + (sNodeList.uItem * sizeof(SNodeItem)), (int)GFP_ATOMIC);
if (pNodeList == NULL) {
result = -ENOMEM;
Expand Down Expand Up @@ -661,7 +661,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
if (copy_to_user(pReq->data, pNodeList, sizeof(SNodeList) + (sNodeList.uItem * sizeof(SNodeItem)))) {
result = -EFAULT;
break;
};
}
kfree(pNodeList);
pReq->wResult = 0;
break;
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/vt6655/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ PSbConsiderPowerDown(
((pDevice->dwIsr& ISR_RXDMA0) != 0) &&
((pDevice->dwIsr & ISR_RXDMA1) != 0)){
return false;
};
}

if (pMgmt->eCurrMode != WMAC_MODE_IBSS_STA) {
if (bCheckCountToWakeUp &&
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/vt6655/rxtx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2902,13 +2902,13 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un
if (pDevice->bEnableHostWEP) {
uNodeIndex = 0;
bNodeExist = true;
};
}
}
else {
if (pDevice->bEnableHostWEP) {
if (BSSDBbIsSTAInNodeDB(pDevice->pMgmt, (unsigned char *)(p80211Header->sA3.abyAddr1), &uNodeIndex))
bNodeExist = true;
};
}
bNeedACK = true;
pTxBufHead->wFIFOCtl |= FIFOCTL_NEEDACK;
};
Expand Down
Loading

0 comments on commit 9fc8602

Please sign in to comment.