Staging: vt6656: Combine "else { if" to "else if"

This patch combines single ifs within the block of an else to a single
else if statement.

Therefore code that looks like that

else {
	if (cond) {
		statements;
	} else {
		other_statements;
	}
}

is converted to code that looks like that

else if (cond) {
	statements;
} else {
	other_statements;
}

Signed-off-by: Sebastian Rachuj <sebastian.rachuj@studium.uni-erlangen.de>
Signed-off-by: Simon Schuster <linux@rationality.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Simon Schuster 2014-01-04 16:25:13 +01:00 committed by Greg Kroah-Hartman
parent 6c64bf8af9
commit fd2251e233

View File

@ -137,14 +137,11 @@ PKnownBSS BSSpSearchBSSList(struct vnt_private *pDevice,
return pCurrBSS; return pCurrBSS;
} }
} }
} else { } else if ((pMgmt->eConfigMode == WMAC_CONFIG_AUTO) ||
if ((pMgmt->eConfigMode == WMAC_CONFIG_AUTO) || ((pMgmt->eConfigMode == WMAC_CONFIG_IBSS_STA) && WLAN_GET_CAP_INFO_IBSS(pCurrBSS->wCapInfo)) ||
((pMgmt->eConfigMode == WMAC_CONFIG_IBSS_STA) && WLAN_GET_CAP_INFO_IBSS(pCurrBSS->wCapInfo)) || ((pMgmt->eConfigMode == WMAC_CONFIG_ESS_STA) && WLAN_GET_CAP_INFO_ESS(pCurrBSS->wCapInfo))) {
((pMgmt->eConfigMode == WMAC_CONFIG_ESS_STA) && WLAN_GET_CAP_INFO_ESS(pCurrBSS->wCapInfo)) pCurrBSS->bSelected = true;
) { return pCurrBSS;
pCurrBSS->bSelected = true;
return pCurrBSS;
}
} }
} }
} }
@ -196,11 +193,9 @@ PKnownBSS BSSpSearchBSSList(struct vnt_private *pDevice,
if (pSelect == NULL) { if (pSelect == NULL) {
pSelect = pCurrBSS; pSelect = pCurrBSS;
} else { /* compare RSSI, select the strongest signal */
/* compare RSSI, select the strongest signal */ } else if (pCurrBSS->uRSSI < pSelect->uRSSI) {
if (pCurrBSS->uRSSI < pSelect->uRSSI) { pSelect = pCurrBSS;
pSelect = pCurrBSS;
}
} }
} }
} }
@ -364,15 +359,12 @@ int BSSbInsertToBSSList(struct vnt_private *pDevice,
pBSSList->sERP.bERPExist = psERP->bERPExist; pBSSList->sERP.bERPExist = psERP->bERPExist;
/* Check if BSS is 802.11a/b/g */ /* Check if BSS is 802.11a/b/g */
if (pBSSList->uChannel > CB_MAX_CHANNEL_24G) { if (pBSSList->uChannel > CB_MAX_CHANNEL_24G)
pBSSList->eNetworkTypeInUse = PHY_TYPE_11A; pBSSList->eNetworkTypeInUse = PHY_TYPE_11A;
} else { else if (pBSSList->sERP.bERPExist == true)
if (pBSSList->sERP.bERPExist == true) { pBSSList->eNetworkTypeInUse = PHY_TYPE_11G;
pBSSList->eNetworkTypeInUse = PHY_TYPE_11G; else
} else { pBSSList->eNetworkTypeInUse = PHY_TYPE_11B;
pBSSList->eNetworkTypeInUse = PHY_TYPE_11B;
}
}
pBSSList->byRxRate = pRxPacket->byRxRate; pBSSList->byRxRate = pRxPacket->byRxRate;
pBSSList->qwLocalTSF = pRxPacket->qwLocalTSF; pBSSList->qwLocalTSF = pRxPacket->qwLocalTSF;
@ -521,15 +513,12 @@ int BSSbUpdateToBSSList(struct vnt_private *pDevice,
pBSSList->sERP.bERPExist = psERP->bERPExist; pBSSList->sERP.bERPExist = psERP->bERPExist;
/* Check if BSS is 802.11a/b/g */ /* Check if BSS is 802.11a/b/g */
if (pBSSList->uChannel > CB_MAX_CHANNEL_24G) { if (pBSSList->uChannel > CB_MAX_CHANNEL_24G)
pBSSList->eNetworkTypeInUse = PHY_TYPE_11A; pBSSList->eNetworkTypeInUse = PHY_TYPE_11A;
} else { else if (pBSSList->sERP.bERPExist == true)
if (pBSSList->sERP.bERPExist == true) { pBSSList->eNetworkTypeInUse = PHY_TYPE_11G;
pBSSList->eNetworkTypeInUse = PHY_TYPE_11G; else
} else { pBSSList->eNetworkTypeInUse = PHY_TYPE_11B;
pBSSList->eNetworkTypeInUse = PHY_TYPE_11B;
}
}
pBSSList->byRxRate = pRxPacket->byRxRate; pBSSList->byRxRate = pRxPacket->byRxRate;
pBSSList->qwLocalTSF = pRxPacket->qwLocalTSF; pBSSList->qwLocalTSF = pRxPacket->qwLocalTSF;
@ -891,11 +880,10 @@ void BSSvSecondCallBack(struct work_struct *work)
/* ii = 0 for multicast node (AP & Adhoc) */ /* ii = 0 for multicast node (AP & Adhoc) */
RATEvTxRateFallBack((void *) pDevice, RATEvTxRateFallBack((void *) pDevice,
&(pMgmt->sNodeDBTable[ii])); &(pMgmt->sNodeDBTable[ii]));
} else { } else if (pMgmt->eCurrMode == WMAC_MODE_ESS_STA) {
/* ii = 0 reserved for unicast AP node (Infra STA) */ /* ii = 0 reserved for unicast AP node (Infra STA) */
if (pMgmt->eCurrMode == WMAC_MODE_ESS_STA) RATEvTxRateFallBack((void *) pDevice,
RATEvTxRateFallBack((void *) pDevice, &(pMgmt->sNodeDBTable[ii]));
&(pMgmt->sNodeDBTable[ii]));
} }
} }
@ -922,11 +910,9 @@ void BSSvSecondCallBack(struct work_struct *work)
MACvEnableProtectMD(pDevice); MACvEnableProtectMD(pDevice);
pDevice->bProtectMode = true; pDevice->bProtectMode = true;
} }
} else { } else if (pDevice->bProtectMode) {
if (pDevice->bProtectMode) { MACvDisableProtectMD(pDevice);
MACvDisableProtectMD(pDevice); pDevice->bProtectMode = false;
pDevice->bProtectMode = false;
}
} }
/* on/off short slot time */ /* on/off short slot time */
@ -936,12 +922,10 @@ void BSSvSecondCallBack(struct work_struct *work)
BBvSetShortSlotTime(pDevice); BBvSetShortSlotTime(pDevice);
vUpdateIFS((void *) pDevice); vUpdateIFS((void *) pDevice);
} }
} else { } else if (!pDevice->bShortSlotTime) {
if (!pDevice->bShortSlotTime) {
pDevice->bShortSlotTime = true; pDevice->bShortSlotTime = true;
BBvSetShortSlotTime(pDevice); BBvSetShortSlotTime(pDevice);
vUpdateIFS((void *) pDevice); vUpdateIFS((void *) pDevice);
}
} }
/* on/off barker long preamble mode */ /* on/off barker long preamble mode */
@ -951,11 +935,9 @@ void BSSvSecondCallBack(struct work_struct *work)
MACvEnableBarkerPreambleMd(pDevice); MACvEnableBarkerPreambleMd(pDevice);
pDevice->bBarkerPreambleMd = true; pDevice->bBarkerPreambleMd = true;
} }
} else { } else if (pDevice->bBarkerPreambleMd) {
if (pDevice->bBarkerPreambleMd) {
MACvDisableBarkerPreambleMd(pDevice); MACvDisableBarkerPreambleMd(pDevice);
pDevice->bBarkerPreambleMd = false; pDevice->bBarkerPreambleMd = false;
}
} }
} }
@ -1031,28 +1013,26 @@ void BSSvSecondCallBack(struct work_struct *work)
if (pDevice->uIsroamingTime >= 20) if (pDevice->uIsroamingTime >= 20)
pDevice->bIsRoaming = false; pDevice->bIsRoaming = false;
} }
} else { } else if (pDevice->uAutoReConnectTime < 10) {
if (pDevice->uAutoReConnectTime < 10) { pDevice->uAutoReConnectTime++;
pDevice->uAutoReConnectTime++; /* network manager support need not do Roaming scan??? */
/* network manager support need not do Roaming scan??? */ if (pDevice->bWPASuppWextEnabled == true)
if (pDevice->bWPASuppWextEnabled == true)
pDevice->uAutoReConnectTime = 0;
} else {
/* mike use old encryption status for wpa reauthen */
if (pDevice->bWPADEVUp)
pDevice->eEncryptionStatus = pDevice->eOldEncryptionStatus;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Roaming ...\n");
BSSvClearBSSList((void *) pDevice, pDevice->bLinkPass);
pMgmt->eScanType = WMAC_SCAN_ACTIVE;
bScheduleCommand((void *) pDevice,
WLAN_CMD_BSSID_SCAN,
pMgmt->abyDesireSSID);
bScheduleCommand((void *) pDevice,
WLAN_CMD_SSID,
pMgmt->abyDesireSSID);
pDevice->uAutoReConnectTime = 0; pDevice->uAutoReConnectTime = 0;
} } else {
/* mike use old encryption status for wpa reauthen */
if (pDevice->bWPADEVUp)
pDevice->eEncryptionStatus = pDevice->eOldEncryptionStatus;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Roaming ...\n");
BSSvClearBSSList((void *) pDevice, pDevice->bLinkPass);
pMgmt->eScanType = WMAC_SCAN_ACTIVE;
bScheduleCommand((void *) pDevice,
WLAN_CMD_BSSID_SCAN,
pMgmt->abyDesireSSID);
bScheduleCommand((void *) pDevice,
WLAN_CMD_SSID,
pMgmt->abyDesireSSID);
pDevice->uAutoReConnectTime = 0;
} }
} }
} }
@ -1203,11 +1183,11 @@ void BSSvUpdateNodeTxCounter(struct vnt_private *pDevice, u8 byTSR, u8 byPktNO)
} }
if ((pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) || if ((pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) ||
(pMgmt->eCurrMode == WMAC_MODE_ESS_AP)) { (pMgmt->eCurrMode == WMAC_MODE_ESS_AP)) {
if (BSSbIsSTAInNodeDB((void *) pDevice, if (BSSbIsSTAInNodeDB((void *) pDevice,
pbyDestAddr, pbyDestAddr,
&uNodeIndex)) { &uNodeIndex)) {
pMgmt->sNodeDBTable[uNodeIndex].uTxAttempts += 1; pMgmt->sNodeDBTable[uNodeIndex].uTxAttempts += 1;
if (!(byTSR & (TSR_TMO | TSR_RETRYTMO))) { if (!(byTSR & (TSR_TMO | TSR_RETRYTMO))) {
/* transmit success, TxAttempts at least plus one */ /* transmit success, TxAttempts at least plus one */