Commit 9fc86028 authored by Joe Perches's avatar Joe Perches Committed by Greg Kroah-Hartman
Browse files

staging: Remove unnecessary semicolons when if (foo) {...};



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: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 60b0fa1a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
}
+4 −4
Original line number Diff line number Diff line
@@ -1289,7 +1289,7 @@ start:
             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)
      {
@@ -1489,7 +1489,7 @@ BSSvUpdateNodeTxCounter(
                    }
                }
            }
        };
        }

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

    return;

+7 −7
Original line number Diff line number Diff line
@@ -900,7 +900,7 @@ static bool device_release_WPADEV(PSDevice pDevice)
	        if(ii>20)
		  break;
              }
           };
           }
    return true;
}

@@ -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;
@@ -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;
@@ -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);
@@ -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)) {
@@ -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
            };
            }

        }

@@ -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) {
+5 −5
Original line number Diff line number Diff line
@@ -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) &&
@@ -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;

@@ -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
@@ -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
@@ -1486,7 +1486,7 @@ static bool s_bAPModeRxData (
                    bRelayOnly = true;
                }
            }
        };
        }
    }

    if (bRelayOnly || bRelayAndForward) {
+19 −19
Original line number Diff line number Diff line
@@ -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) {
@@ -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
@@ -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;
@@ -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);
@@ -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;
@@ -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;

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

@@ -325,7 +325,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
        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;
@@ -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;
@@ -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:

@@ -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");
@@ -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;
@@ -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;
@@ -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);
@@ -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;
@@ -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;

@@ -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;
@@ -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;
Loading