staging: rtl8192e: do not use comparisons on bool tests
authorValentina Manea <valentina.manea.m@gmail.com>
Fri, 25 Oct 2013 08:28:10 +0000 (11:28 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Oct 2013 21:28:35 +0000 (14:28 -0700)
This patch fixes coccinelle errors regarding comparisons
used in bool tests.

Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com>
Reviewed-by: Lisa Nguyen <lisa@xenapiadmin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
drivers/staging/rtl8192e/rtl8192e/rtl_core.c
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
drivers/staging/rtl8192e/rtl819x_TSProc.c
drivers/staging/rtl8192e/rtllib_rx.c
drivers/staging/rtl8192e/rtllib_softmac.c
drivers/staging/rtl8192e/rtllib_tx.c
drivers/staging/rtl8192e/rtllib_wx.c

index 0da56c80f08839f3b8e88623e850a616281a9b23..5af1c19142de6f462cf039c070e3849277988110 100644 (file)
@@ -140,7 +140,7 @@ bool phy_RF8256_Config_ParaFile(struct net_device *dev)
 
                rtStatus = rtl8192_phy_checkBBAndRF(dev, HW90_BLOCK_RF,
                                                (enum rf90_radio_path)eRFPath);
-               if (rtStatus != true) {
+               if (!rtStatus) {
                        RT_TRACE(COMP_ERR, "PHY_RF8256_Config():Check "
                                 "Radio[%d] Fail!!\n", eRFPath);
                        goto phy_RF8256_Config_ParaFile_Fail;
@@ -245,7 +245,7 @@ void PHY_SetRF8256CCKTxPower(struct net_device *dev, u8     powerlevel)
        struct r8192_priv *priv = rtllib_priv(dev);
 
        TxAGC = powerlevel;
-       if (priv->bDynamicTxLowPower == true) {
+       if (priv->bDynamicTxLowPower) {
                if (priv->CustomerID == RT_CID_819x_Netcore)
                        TxAGC = 0x22;
                else
@@ -294,7 +294,7 @@ void PHY_SetRF8256OFDMTxPower(struct net_device *dev, u8 powerlevel)
                        priv->Pwr_Track = writeVal_tmp;
                }
 
-               if (priv->bDynamicTxHighPower == true)
+               if (priv->bDynamicTxHighPower)
                        writeVal = 0x03030303;
                else
                        writeVal = (byte3 << 24) | (byte2 << 16) |
index 6616b3a20bc996611809fa246179b3544d1aaafb..a816a57030fe3c623044949825b1cc449621ae8a 100644 (file)
@@ -720,7 +720,7 @@ start:
        }
        priv->pFirmware->firmware_status = FW_STATUS_0_INIT;
 
-       if (priv->RegRfOff == true)
+       if (priv->RegRfOff)
                priv->rtllib->eRFPowerState = eRfOff;
 
        ulRegRead = read_nic_dword(dev, CPU_GEN);
@@ -745,7 +745,7 @@ start:
        }
        RT_TRACE(COMP_INIT, "BB Config Start!\n");
        rtStatus = rtl8192_BBConfig(dev);
-       if (rtStatus != true) {
+       if (!rtStatus) {
                RT_TRACE(COMP_ERR, "BB Config failed\n");
                return rtStatus;
        }
@@ -856,7 +856,7 @@ start:
        if (priv->ResetProgress == RESET_TYPE_NORESET) {
                RT_TRACE(COMP_INIT, "RF Config Started!\n");
                rtStatus = rtl8192_phy_RFConfig(dev);
-               if (rtStatus != true) {
+               if (!rtStatus) {
                        RT_TRACE(COMP_ERR, "RF Config failed\n");
                        return rtStatus;
                }
@@ -869,7 +869,7 @@ start:
 
        write_nic_byte(dev, 0x87, 0x0);
 
-       if (priv->RegRfOff == true) {
+       if (priv->RegRfOff) {
                RT_TRACE((COMP_INIT | COMP_RF | COMP_POWER),
                          "%s(): Turn off RF for RegRfOff ----------\n",
                          __func__);
index dd2a96bfcc0c00126d0b2bab5e6e797859f8dcbe..abcd22f8fdda576e55854869b3e93e9731639825 100644 (file)
@@ -329,7 +329,7 @@ bool init_firmware(struct net_device *dev)
                }
 
                rt_status = fw_download_code(dev, mapped_file, file_length);
-               if (rt_status != true) {
+               if (!rt_status) {
                        goto download_firmware_fail;
                }
 
index 9676c591c8597574413bd4463d79263b0a63447d..21e6ddde68a2bb4ac389184d3eae7b7628874c65 100644 (file)
@@ -567,7 +567,7 @@ static bool rtl8192_BB_Config_ParaFile(struct net_device *dev)
                rtStatus  = rtl8192_phy_checkBBAndRF(dev,
                                         (enum hw90_block)eCheckItem,
                                         (enum rf90_radio_path)0);
-               if (rtStatus != true) {
+               if (!rtStatus) {
                        RT_TRACE((COMP_ERR | COMP_PHY), "PHY_RF8256_Config():"
                                 "Check PHY%d Fail!!\n", eCheckItem-1);
                        return rtStatus;
@@ -1425,7 +1425,7 @@ static bool SetRFPowerState8190(struct net_device *dev,
        u8      i = 0, QueueID = 0;
        struct rtl8192_tx_ring  *ring = NULL;
 
-       if (priv->SetRFPowerStateInProgress == true)
+       if (priv->SetRFPowerStateInProgress)
                return false;
        RT_TRACE(COMP_PS, "===========> SetRFPowerState8190()!\n");
        priv->SetRFPowerStateInProgress = true;
@@ -1443,10 +1443,9 @@ static bool SetRFPowerState8190(struct net_device *dev,
                                        InitilizeCount--;
                                        priv->RegRfOff = false;
                                        rtstatus = NicIFEnableNIC(dev);
-                               } while ((rtstatus != true) &&
-                                        (InitilizeCount > 0));
+                               } while (!rtstatus && (InitilizeCount > 0));
 
-                               if (rtstatus != true) {
+                               if (!rtstatus) {
                                        RT_TRACE(COMP_ERR, "%s():Initialize Ada"
                                                 "pter fail,return\n",
                                                 __func__);
index b01f6f5c2c44bb6964dbc3b969855069676f0816..6ba02fcd57daac1f01e3a585e0e97a6c2342552e 100644 (file)
@@ -370,8 +370,7 @@ bool MgntActSet_RF_State(struct net_device *dev,
        case eRfOn:
                priv->rtllib->RfOffReason &= (~ChangeSource);
 
-               if ((ChangeSource == RF_CHANGE_BY_HW) &&
-                   (priv->bHwRadioOff == true))
+               if ((ChangeSource == RF_CHANGE_BY_HW) && priv->bHwRadioOff)
                        priv->bHwRadioOff = false;
 
                if (!priv->rtllib->RfOffReason) {
@@ -405,8 +404,7 @@ bool MgntActSet_RF_State(struct net_device *dev,
                                                      disas_lv_ss);
                        }
                }
-               if ((ChangeSource == RF_CHANGE_BY_HW) &&
-                    (priv->bHwRadioOff == false))
+               if ((ChangeSource == RF_CHANGE_BY_HW) && !priv->bHwRadioOff)
                        priv->bHwRadioOff = true;
                priv->rtllib->RfOffReason |= ChangeSource;
                bActionAllowed = true;
@@ -428,7 +426,7 @@ bool MgntActSet_RF_State(struct net_device *dev,
                PHY_SetRFPowerState(dev, StateToSet);
                if (StateToSet == eRfOn) {
 
-                       if (bConnectBySSID && (priv->blinked_ingpio == true)) {
+                       if (bConnectBySSID && priv->blinked_ingpio) {
                                queue_delayed_work_rsl(ieee->wq,
                                         &ieee->associate_procedure_wq, 0);
                                priv->blinked_ingpio = false;
@@ -955,7 +953,7 @@ static int _rtl8192_sta_up(struct net_device *dev, bool is_silent_reset)
        RT_TRACE(COMP_INIT, "Bringing up iface");
        priv->bfirst_init = true;
        init_status = priv->ops->initialize_adapter(dev);
-       if (init_status != true) {
+       if (!init_status) {
                RT_TRACE(COMP_ERR, "ERR!!! %s(): initialization is failed!\n",
                         __func__);
                priv->bfirst_init = false;
@@ -1647,7 +1645,7 @@ void      rtl819x_watchdog_wqcallback(void *data)
        bool    bHigherBusyRxTraffic = false;
        bool bEnterPS = false;
 
-       if (IS_NIC_DOWN(priv) || (priv->bHwRadioOff == true))
+       if (IS_NIC_DOWN(priv) || priv->bHwRadioOff)
                return;
 
        if (priv->rtllib->state >= RTLLIB_LINKED) {
@@ -3045,7 +3043,7 @@ bool NicIFEnableNIC(struct net_device *dev)
        RT_TRACE(COMP_PS, "===========>%s()\n", __func__);
        priv->bfirst_init = true;
        init_status = priv->ops->initialize_adapter(dev);
-       if (init_status != true) {
+       if (!init_status) {
                RT_TRACE(COMP_ERR, "ERR!!! %s(): initialization is failed!\n",
                         __func__);
                priv->bdisable_nic = false;
index 1853665764a019d9777a615e3ae10d7683ec9c5d..bdab150d927eda1636fc3911538e0fa43c5f52f3 100644 (file)
@@ -535,7 +535,7 @@ static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev)
                                }
                        }
 
-                       if (viviflag == true) {
+                       if (viviflag) {
                                write_nic_byte(dev, Pw_Track_Flag, 0);
                                viviflag = false;
                                RT_TRACE(COMP_POWER_TRACKING, "we filted this data\n");
@@ -2273,12 +2273,12 @@ void dm_CheckRfCtrlGPIO(void *data)
 
        eRfPowerStateToSet = (tmp1byte&BIT1) ?  eRfOn : eRfOff;
 
-       if ((priv->bHwRadioOff == true) && (eRfPowerStateToSet == eRfOn)) {
+       if (priv->bHwRadioOff && (eRfPowerStateToSet == eRfOn)) {
                RT_TRACE(COMP_RF, "gpiochangeRF  - HW Radio ON\n");
                printk(KERN_INFO "gpiochangeRF  - HW Radio ON\n");
                priv->bHwRadioOff = false;
                bActuallySet = true;
-       } else if ((priv->bHwRadioOff == false) && (eRfPowerStateToSet == eRfOff)) {
+       } else if (!priv->bHwRadioOff && (eRfPowerStateToSet == eRfOff)) {
                RT_TRACE(COMP_RF, "gpiochangeRF  - HW Radio OFF\n");
                printk(KERN_INFO "gpiochangeRF  - HW Radio OFF\n");
                priv->bHwRadioOff = true;
@@ -2289,7 +2289,7 @@ void dm_CheckRfCtrlGPIO(void *data)
                mdelay(1000);
                priv->bHwRfOffAction = 1;
                MgntActSet_RF_State(dev, eRfPowerStateToSet, RF_CHANGE_BY_HW, true);
-               if (priv->bHwRadioOff == true)
+               if (priv->bHwRadioOff)
                        argv[1] = "RFOFF";
                else
                        argv[1] = "RFON";
@@ -2946,8 +2946,7 @@ static void dm_dynamic_txpower(struct net_device *dev)
                        priv->bDynamicTxLowPower = false;
                } else {
                        if (priv->undecorated_smoothed_pwdb <
-                           txlowpower_threshold &&
-                           priv->bDynamicTxHighPower == true)
+                           txlowpower_threshold && priv->bDynamicTxHighPower)
                                priv->bDynamicTxHighPower = false;
                        if (priv->undecorated_smoothed_pwdb < 35)
                                priv->bDynamicTxLowPower = true;
index 658e875232aa7948f56146770c9b848b6b70420b..29608e5488a44dd6c45346a76d169f9b2d4cddb1 100644 (file)
@@ -264,7 +264,7 @@ static struct ts_common_info *SearchAdmitTRStream(struct rtllib_device *ieee,
                psearch_list = &ieee->Rx_TS_Admit_List;
 
        for (dir = 0; dir <= DIR_BI_DIR; dir++) {
-               if (search_dir[dir] == false)
+               if (!search_dir[dir])
                        continue;
                list_for_each_entry(pRet, psearch_list, List) {
                        if (memcmp(pRet->Addr, Addr, 6) == 0)
@@ -348,7 +348,7 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS,
        if (*ppTS != NULL) {
                return true;
        } else {
-               if (bAddNewTs == false) {
+               if (!bAddNewTs) {
                        RTLLIB_DEBUG(RTLLIB_DL_TS, "add new TS failed"
                                     "(tid:%d)\n", UP);
                        return false;
index 8ee80c50303ad8dc07e5b5a3a94cae9e51c19f19..6862172af172fbe19e86766d7a9ac614270d4167 100644 (file)
@@ -1729,7 +1729,7 @@ static inline void rtllib_extract_country_ie(
                        network->CountryIeLen = info_element->len;
 
                        if (!IS_COUNTRY_IE_VALID(ieee)) {
-                               if ((rtllib_act_scanning(ieee, false) == true) && (ieee->FirstIe_InScan == 1))
+                               if (rtllib_act_scanning(ieee, false) && ieee->FirstIe_InScan)
                                        printk(KERN_INFO "Received beacon ContryIE, SSID: <%s>\n", network->ssid);
                                Dot11d_UpdateCountryIe(ieee, addr2, info_element->len, info_element->data);
                        }
index 0cbf6f5593a394d99ed58b6a95e7df88cfbe1625..e74d24212a3950dd5da4ae648f88f1d90763b2e5 100644 (file)
@@ -604,7 +604,7 @@ static void rtllib_softmac_scan_wq(void *data)
 
        if (!ieee->ieee_up)
                return;
-       if (rtllib_act_scanning(ieee, true) == true)
+       if (rtllib_act_scanning(ieee, true))
                return;
 
        down(&ieee->scan_sem);
@@ -1202,7 +1202,7 @@ inline struct sk_buff *rtllib_association_req(struct rtllib_network *beacon,
 
        if ((ieee->rtllib_ap_sec_type &&
            (ieee->rtllib_ap_sec_type(ieee) & SEC_ALG_TKIP)) ||
-           (ieee->bForcedBgMode == true)) {
+           ieee->bForcedBgMode) {
                ieee->pHTInfo->bEnableHT = 0;
                ieee->mode = WIRELESS_MODE_G;
        }
@@ -1535,7 +1535,7 @@ static void rtllib_associate_complete_wq(void *data)
        struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
                                        (&(ieee->PowerSaveControl));
        printk(KERN_INFO "Associated successfully\n");
-       if (ieee->is_silent_reset == 0) {
+       if (!ieee->is_silent_reset) {
                printk(KERN_INFO "normal associate\n");
                notify_wx_assoc_event(ieee);
        }
@@ -1572,7 +1572,7 @@ static void rtllib_associate_complete_wq(void *data)
        pPSC->LpsIdleCount = 0;
        ieee->link_change(ieee->dev);
 
-       if (ieee->is_silent_reset == 1) {
+       if (ieee->is_silent_reset) {
                printk(KERN_INFO "silent reset associate\n");
                ieee->is_silent_reset = 0;
        }
@@ -2005,7 +2005,7 @@ static short rtllib_sta_ps_sleep(struct rtllib_device *ieee, u64 *time)
                return 0;
 
        if (time) {
-               if (ieee->bAwakePktSent == true) {
+               if (ieee->bAwakePktSent) {
                        pPSC->LPSAwakeIntvl = 1;
                } else {
                        u8              MaxPeriod = 1;
@@ -2338,8 +2338,7 @@ inline int rtllib_rx_auth(struct rtllib_device *ieee, struct sk_buff *skb,
                                        }
 
                                        if (ieee->current_network.mode ==
-                                           IEEE_N_24G &&
-                                           bHalfSupportNmode == true) {
+                                           IEEE_N_24G && bHalfSupportNmode) {
                                                printk(KERN_INFO "======>enter "
                                                       "half N mode\n");
                                                ieee->bHalfWirelessN24GMode =
index 1cc6a9d5e8a3da3e42c520a76411a8217c25fb37..3183627823fb58fb3def9fb89090f98281732ec4 100644 (file)
@@ -908,7 +908,7 @@ int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)
                                tcb_desc->data_rate = CURRENT_RATE(ieee->mode,
                                        ieee->rate, ieee->HTCurrentOperaRate);
 
-                       if (bdhcp == true) {
+                       if (bdhcp) {
                                if (ieee->pHTInfo->IOTAction &
                                    HT_IOT_ACT_WA_IOT_Broadcom) {
                                        tcb_desc->data_rate =
index c7e8d4d8ec2b8fc2b8e766f7c776237dee130b94..13af43b90fc00de2ecf473500590c94d1899c9e7 100644 (file)
@@ -753,7 +753,7 @@ int rtllib_wx_set_mlme(struct rtllib_device *ieee,
                /* leave break out intentionly */
 
        case IW_MLME_DISASSOC:
-               if (deauth == true)
+               if (deauth)
                        printk(KERN_INFO "disauth packet !\n");
                else
                        printk(KERN_INFO "dis associate packet!\n");