Commit 2b0c2a48 authored by Teodora Baluta's avatar Teodora Baluta Committed by Greg Kroah-Hartman

staging: vt6655: delete explicit comparison to bool

This patch fixes all bool tests by deleting the comparison. Most of
these were detected using coccinelle and silence the following type of
coccinelle warnings for drivers/staging/vt6655/bssdb.c file:

WARNING: Comparison to bool
Signed-off-by: default avatarTeodora Baluta <teobaluta@gmail.com>
Reviewed-by: default avatarPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a7772898
...@@ -142,10 +142,10 @@ BSSpSearchBSSList( ...@@ -142,10 +142,10 @@ BSSpSearchBSSList(
/* match BSSID first */ /* match BSSID first */
for (ii = 0; ii < MAX_BSS_NUM; ii++) { for (ii = 0; ii < MAX_BSS_NUM; ii++) {
pCurrBSS = &(pMgmt->sBSSList[ii]); pCurrBSS = &(pMgmt->sBSSList[ii]);
if (pDevice->bLinkPass == false) if (!pDevice->bLinkPass)
pCurrBSS->bSelected = false; pCurrBSS->bSelected = false;
if ((pCurrBSS->bActive) && if ((pCurrBSS->bActive) &&
(pCurrBSS->bSelected == false)) { (!pCurrBSS->bSelected)) {
if (ether_addr_equal(pCurrBSS->abyBSSID, if (ether_addr_equal(pCurrBSS->abyBSSID,
pbyBSSID)) { pbyBSSID)) {
if (pSSID != NULL) { if (pSSID != NULL) {
...@@ -390,7 +390,7 @@ BSSbInsertToBSSList( ...@@ -390,7 +390,7 @@ BSSbInsertToBSSList(
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)
pBSSList->eNetworkTypeInUse = PHY_TYPE_11G; pBSSList->eNetworkTypeInUse = PHY_TYPE_11G;
else else
pBSSList->eNetworkTypeInUse = PHY_TYPE_11B; pBSSList->eNetworkTypeInUse = PHY_TYPE_11B;
...@@ -431,7 +431,7 @@ BSSbInsertToBSSList( ...@@ -431,7 +431,7 @@ BSSbInsertToBSSList(
} }
} }
if ((pMgmt->eAuthenMode == WMAC_AUTH_WPA2) || (pBSSList->bWPA2Valid == true)) { if ((pMgmt->eAuthenMode == WMAC_AUTH_WPA2) || pBSSList->bWPA2Valid) {
PSKeyItem pTransmitKey = NULL; PSKeyItem pTransmitKey = NULL;
bool bIs802_1x = false; bool bIs802_1x = false;
...@@ -441,13 +441,13 @@ BSSbInsertToBSSList( ...@@ -441,13 +441,13 @@ BSSbInsertToBSSList(
break; break;
} }
} }
if ((bIs802_1x == true) && (pSSID->len == ((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->len) && if (bIs802_1x && (pSSID->len == ((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->len) &&
(!memcmp(pSSID->abySSID, ((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySSID, pSSID->len))) { (!memcmp(pSSID->abySSID, ((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySSID, pSSID->len))) {
bAdd_PMKID_Candidate((void *)pDevice, pBSSList->abyBSSID, &pBSSList->sRSNCapObj); bAdd_PMKID_Candidate((void *)pDevice, pBSSList->abyBSSID, &pBSSList->sRSNCapObj);
if ((pDevice->bLinkPass == true) && (pMgmt->eCurrState == WMAC_STATE_ASSOC)) { if (pDevice->bLinkPass && (pMgmt->eCurrState == WMAC_STATE_ASSOC)) {
if ((KeybGetTransmitKey(&(pDevice->sKey), pDevice->abyBSSID, PAIRWISE_KEY, &pTransmitKey) == true) || if (KeybGetTransmitKey(&(pDevice->sKey), pDevice->abyBSSID, PAIRWISE_KEY, &pTransmitKey) ||
(KeybGetTransmitKey(&(pDevice->sKey), pDevice->abyBSSID, GROUP_KEY, &pTransmitKey) == true)) { KeybGetTransmitKey(&(pDevice->sKey), pDevice->abyBSSID, GROUP_KEY, &pTransmitKey)) {
pDevice->gsPMKIDCandidate.StatusType = Ndis802_11StatusType_PMKID_CandidateList; pDevice->gsPMKIDCandidate.StatusType = Ndis802_11StatusType_PMKID_CandidateList;
pDevice->gsPMKIDCandidate.Version = 1; pDevice->gsPMKIDCandidate.Version = 1;
...@@ -466,13 +466,12 @@ BSSbInsertToBSSList( ...@@ -466,13 +466,12 @@ BSSbInsertToBSSList(
pBSSList->ldBmAverage[ii] = 0; pBSSList->ldBmAverage[ii] = 0;
} }
if ((pIE_Country != NULL) && if ((pIE_Country != NULL) && pMgmt->b11hEnable) {
(pMgmt->b11hEnable == true)) {
set_country_info(pMgmt->pAdapter, pBSSList->eNetworkTypeInUse, set_country_info(pMgmt->pAdapter, pBSSList->eNetworkTypeInUse,
pIE_Country); pIE_Country);
} }
if ((bParsingQuiet == true) && (pIE_Quiet != NULL)) { if (bParsingQuiet && (pIE_Quiet != NULL)) {
if ((((PWLAN_IE_QUIET)pIE_Quiet)->len == 8) && if ((((PWLAN_IE_QUIET)pIE_Quiet)->len == 8) &&
(((PWLAN_IE_QUIET)pIE_Quiet)->byQuietCount != 0)) { (((PWLAN_IE_QUIET)pIE_Quiet)->byQuietCount != 0)) {
/* valid EID */ /* valid EID */
...@@ -498,8 +497,7 @@ BSSbInsertToBSSList( ...@@ -498,8 +497,7 @@ BSSbInsertToBSSList(
} }
} }
if ((bParsingQuiet == true) && if (bParsingQuiet && (pQuiet != NULL)) {
(pQuiet != NULL)) {
CARDbStartQuiet(pMgmt->pAdapter); CARDbStartQuiet(pMgmt->pAdapter);
} }
...@@ -580,7 +578,7 @@ BSSbUpdateToBSSList( ...@@ -580,7 +578,7 @@ BSSbUpdateToBSSList(
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)
pBSSList->eNetworkTypeInUse = PHY_TYPE_11G; pBSSList->eNetworkTypeInUse = PHY_TYPE_11G;
else else
pBSSList->eNetworkTypeInUse = PHY_TYPE_11B; pBSSList->eNetworkTypeInUse = PHY_TYPE_11B;
...@@ -633,13 +631,12 @@ BSSbUpdateToBSSList( ...@@ -633,13 +631,12 @@ BSSbUpdateToBSSList(
} }
} }
if ((pIE_Country != NULL) && if ((pIE_Country != NULL) && pMgmt->b11hEnable) {
(pMgmt->b11hEnable == true)) {
set_country_info(pMgmt->pAdapter, pBSSList->eNetworkTypeInUse, set_country_info(pMgmt->pAdapter, pBSSList->eNetworkTypeInUse,
pIE_Country); pIE_Country);
} }
if ((bParsingQuiet == true) && (pIE_Quiet != NULL)) { if (bParsingQuiet && (pIE_Quiet != NULL)) {
if ((((PWLAN_IE_QUIET)pIE_Quiet)->len == 8) && if ((((PWLAN_IE_QUIET)pIE_Quiet)->len == 8) &&
(((PWLAN_IE_QUIET)pIE_Quiet)->byQuietCount != 0)) { (((PWLAN_IE_QUIET)pIE_Quiet)->byQuietCount != 0)) {
/* valid EID */ /* valid EID */
...@@ -665,8 +662,7 @@ BSSbUpdateToBSSList( ...@@ -665,8 +662,7 @@ BSSbUpdateToBSSList(
} }
} }
if ((bParsingQuiet == true) && if (bParsingQuiet && (pQuiet != NULL)) {
(pQuiet != NULL)) {
CARDbStartQuiet(pMgmt->pAdapter); CARDbStartQuiet(pMgmt->pAdapter);
} }
...@@ -934,10 +930,12 @@ BSSvSecondCallBack( ...@@ -934,10 +930,12 @@ BSSvSecondCallBack(
/* 2008-4-14 <add> by chester for led issue */ /* 2008-4-14 <add> by chester for led issue */
#ifdef FOR_LED_ON_NOTEBOOK #ifdef FOR_LED_ON_NOTEBOOK
MACvGPIOIn(pDevice->PortOffset, &pDevice->byGPIO); MACvGPIOIn(pDevice->PortOffset, &pDevice->byGPIO);
if (((!(pDevice->byGPIO & GPIO0_DATA) && (pDevice->bHWRadioOff == false)) || ((pDevice->byGPIO & GPIO0_DATA) && (pDevice->bHWRadioOff == true))) && (cc == false)) { if (((!(pDevice->byGPIO & GPIO0_DATA) && (!pDevice->bHWRadioOff)) ||
((pDevice->byGPIO & GPIO0_DATA) && pDevice->bHWRadioOff)) &&
(!cc)) {
cc = true; cc = true;
} else if (cc == true) { } else if (cc) {
if (pDevice->bHWRadioOff == true) { if (pDevice->bHWRadioOff) {
if (!(pDevice->byGPIO & GPIO0_DATA)) { if (!(pDevice->byGPIO & GPIO0_DATA)) {
if (status == 1) if (status == 1)
goto start; goto start;
...@@ -988,7 +986,7 @@ BSSvSecondCallBack( ...@@ -988,7 +986,7 @@ BSSvSecondCallBack(
{ {
pDevice->byReAssocCount++; pDevice->byReAssocCount++;
/* 10 sec timeout */ /* 10 sec timeout */
if ((pDevice->byReAssocCount > 10) && (pDevice->bLinkPass != true)) { if ((pDevice->byReAssocCount > 10) && (!pDevice->bLinkPass)) {
netdev_info(pDevice->dev, "Re-association timeout!!!\n"); netdev_info(pDevice->dev, "Re-association timeout!!!\n");
pDevice->byReAssocCount = 0; pDevice->byReAssocCount = 0;
#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
...@@ -1000,7 +998,7 @@ BSSvSecondCallBack( ...@@ -1000,7 +998,7 @@ BSSvSecondCallBack(
wireless_send_event(pDevice->dev, SIOCGIWAP, &wrqu, NULL); wireless_send_event(pDevice->dev, SIOCGIWAP, &wrqu, NULL);
} }
#endif #endif
} else if (pDevice->bLinkPass == true) } else if (pDevice->bLinkPass)
pDevice->byReAssocCount = 0; pDevice->byReAssocCount = 0;
} }
...@@ -1188,7 +1186,7 @@ BSSvSecondCallBack( ...@@ -1188,7 +1186,7 @@ BSSvSecondCallBack(
* network manager support need not do * network manager support need not do
* Roaming scan??? * Roaming scan???
*/ */
if (pDevice->bWPASuppWextEnabled == true) if (pDevice->bWPASuppWextEnabled)
pDevice->uAutoReConnectTime = 0; pDevice->uAutoReConnectTime = 0;
#endif #endif
} else { } else {
...@@ -1520,7 +1518,7 @@ void s_uCalculateLinkQual( ...@@ -1520,7 +1518,7 @@ void s_uCalculateLinkQual(
TxOkRatio = (TxCnt < 6) ? 4000 : ((pDevice->scStatistic.TxNoRetryOkCount * 4000) / TxCnt); TxOkRatio = (TxCnt < 6) ? 4000 : ((pDevice->scStatistic.TxNoRetryOkCount * 4000) / TxCnt);
RxOkRatio = (RxCnt < 6) ? 2000 : ((pDevice->scStatistic.RxOkCnt * 2000) / RxCnt); RxOkRatio = (RxCnt < 6) ? 2000 : ((pDevice->scStatistic.RxOkCnt * 2000) / RxCnt);
/* decide link quality */ /* decide link quality */
if (pDevice->bLinkPass != true) { if (!pDevice->bLinkPass) {
pDevice->scStatistic.LinkQuality = 0; pDevice->scStatistic.LinkQuality = 0;
pDevice->scStatistic.SignalStren = 0; pDevice->scStatistic.SignalStren = 0;
} else { } else {
......
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