Commit fd2251e2 authored by Simon Schuster's avatar Simon Schuster Committed by Greg Kroah-Hartman

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: default avatarSebastian Rachuj <sebastian.rachuj@studium.uni-erlangen.de>
Signed-off-by: default avatarSimon Schuster <linux@rationality.eu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6c64bf8a
......@@ -137,18 +137,15 @@ PKnownBSS BSSpSearchBSSList(struct vnt_private *pDevice,
return pCurrBSS;
}
}
} else {
if ((pMgmt->eConfigMode == WMAC_CONFIG_AUTO) ||
} else if ((pMgmt->eConfigMode == WMAC_CONFIG_AUTO) ||
((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;
}
}
}
}
}
} else {
/* ignore BSSID */
for (ii = 0; ii < MAX_BSS_NUM; ii++) {
......@@ -196,14 +193,12 @@ PKnownBSS BSSpSearchBSSList(struct vnt_private *pDevice,
if (pSelect == NULL) {
pSelect = pCurrBSS;
} else {
/* compare RSSI, select the strongest signal */
if (pCurrBSS->uRSSI < pSelect->uRSSI) {
} else if (pCurrBSS->uRSSI < pSelect->uRSSI) {
pSelect = pCurrBSS;
}
}
}
}
pDevice->bSameBSSMaxNum = jj;
......@@ -364,15 +359,12 @@ int BSSbInsertToBSSList(struct vnt_private *pDevice,
pBSSList->sERP.bERPExist = psERP->bERPExist;
/* 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;
} else {
if (pBSSList->sERP.bERPExist == true) {
else if (pBSSList->sERP.bERPExist == true)
pBSSList->eNetworkTypeInUse = PHY_TYPE_11G;
} else {
else
pBSSList->eNetworkTypeInUse = PHY_TYPE_11B;
}
}
pBSSList->byRxRate = pRxPacket->byRxRate;
pBSSList->qwLocalTSF = pRxPacket->qwLocalTSF;
......@@ -521,15 +513,12 @@ int BSSbUpdateToBSSList(struct vnt_private *pDevice,
pBSSList->sERP.bERPExist = psERP->bERPExist;
/* 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;
} else {
if (pBSSList->sERP.bERPExist == true) {
else if (pBSSList->sERP.bERPExist == true)
pBSSList->eNetworkTypeInUse = PHY_TYPE_11G;
} else {
else
pBSSList->eNetworkTypeInUse = PHY_TYPE_11B;
}
}
pBSSList->byRxRate = pRxPacket->byRxRate;
pBSSList->qwLocalTSF = pRxPacket->qwLocalTSF;
......@@ -891,9 +880,8 @@ void BSSvSecondCallBack(struct work_struct *work)
/* ii = 0 for multicast node (AP & Adhoc) */
RATEvTxRateFallBack((void *) pDevice,
&(pMgmt->sNodeDBTable[ii]));
} else {
} else if (pMgmt->eCurrMode == WMAC_MODE_ESS_STA) {
/* ii = 0 reserved for unicast AP node (Infra STA) */
if (pMgmt->eCurrMode == WMAC_MODE_ESS_STA)
RATEvTxRateFallBack((void *) pDevice,
&(pMgmt->sNodeDBTable[ii]));
}
......@@ -922,12 +910,10 @@ void BSSvSecondCallBack(struct work_struct *work)
MACvEnableProtectMD(pDevice);
pDevice->bProtectMode = true;
}
} else {
if (pDevice->bProtectMode) {
} else if (pDevice->bProtectMode) {
MACvDisableProtectMD(pDevice);
pDevice->bProtectMode = false;
}
}
/* on/off short slot time */
if (uNonShortSlotSTACnt > 0) {
......@@ -936,13 +922,11 @@ void BSSvSecondCallBack(struct work_struct *work)
BBvSetShortSlotTime(pDevice);
vUpdateIFS((void *) pDevice);
}
} else {
if (!pDevice->bShortSlotTime) {
} else if (!pDevice->bShortSlotTime) {
pDevice->bShortSlotTime = true;
BBvSetShortSlotTime(pDevice);
vUpdateIFS((void *) pDevice);
}
}
/* on/off barker long preamble mode */
......@@ -951,12 +935,10 @@ void BSSvSecondCallBack(struct work_struct *work)
MACvEnableBarkerPreambleMd(pDevice);
pDevice->bBarkerPreambleMd = true;
}
} else {
if (pDevice->bBarkerPreambleMd) {
} else if (pDevice->bBarkerPreambleMd) {
MACvDisableBarkerPreambleMd(pDevice);
pDevice->bBarkerPreambleMd = false;
}
}
}
......@@ -1031,8 +1013,7 @@ void BSSvSecondCallBack(struct work_struct *work)
if (pDevice->uIsroamingTime >= 20)
pDevice->bIsRoaming = false;
}
} else {
if (pDevice->uAutoReConnectTime < 10) {
} else if (pDevice->uAutoReConnectTime < 10) {
pDevice->uAutoReConnectTime++;
/* network manager support need not do Roaming scan??? */
if (pDevice->bWPASuppWextEnabled == true)
......@@ -1055,7 +1036,6 @@ void BSSvSecondCallBack(struct work_struct *work)
}
}
}
}
if (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) {
/* if adhoc started which essid is NULL string, rescanning. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment