]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
rtlwifi: rtl8192{c,ce,cu,se}: Remove comparisons of booleans with true
authorMike McCormack <mikem@ring3k.org>
Mon, 20 Jun 2011 01:47:51 +0000 (10:47 +0900)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 20 Jun 2011 19:47:43 +0000 (15:47 -0400)
These are a potential source of confusion, as most C code treats all
non-zero values as true.

Signed-off-by: Mike McCormack <mikem@ring3k.org>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
20 files changed:
drivers/net/wireless/rtlwifi/base.c
drivers/net/wireless/rtlwifi/core.c
drivers/net/wireless/rtlwifi/efuse.c
drivers/net/wireless/rtlwifi/ps.c
drivers/net/wireless/rtlwifi/rc.c
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
drivers/net/wireless/rtlwifi/rtl8192ce/led.c
drivers/net/wireless/rtlwifi/rtl8192ce/rf.c
drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
drivers/net/wireless/rtlwifi/rtl8192cu/led.c
drivers/net/wireless/rtlwifi/rtl8192cu/rf.c
drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
drivers/net/wireless/rtlwifi/rtl8192se/dm.c
drivers/net/wireless/rtlwifi/rtl8192se/hw.c
drivers/net/wireless/rtlwifi/rtl8192se/led.c
drivers/net/wireless/rtlwifi/rtl8192se/phy.c
drivers/net/wireless/rtlwifi/rtl8192se/rf.c
drivers/net/wireless/rtlwifi/rtl8192se/trx.c

index fb5e43bd7c3c8076ccc0942998e2a0ea1d576fc0..bc13533a54181464a7ac15fb3f37d97e81e41407 100644 (file)
@@ -523,7 +523,7 @@ static void _rtl_query_shortgi(struct ieee80211_hw *hw,
                mac->opmode == NL80211_IFTYPE_ADHOC)
                bw_40 = sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40;
 
-       if ((bw_40 == true) && sgi_40)
+       if (bw_40 && sgi_40)
                tcb_desc->use_shortgi = true;
        else if ((bw_40 == false) && sgi_20)
                tcb_desc->use_shortgi = true;
index 3313ce6ffaadb014807299aed2e55d8bb6f789d5..03ce69660b261414270966edd094338b50298019 100644 (file)
@@ -443,11 +443,11 @@ static int rtl_op_sta_add(struct ieee80211_hw *hw,
                        sta_entry->wireless_mode = WIRELESS_MODE_G;
                        if (sta->supp_rates[0] <= 0xf)
                                sta_entry->wireless_mode = WIRELESS_MODE_B;
-                       if (sta->ht_cap.ht_supported == true)
+                       if (sta->ht_cap.ht_supported)
                                sta_entry->wireless_mode = WIRELESS_MODE_N_24G;
                } else if (rtlhal->current_bandtype == BAND_ON_5G) {
                        sta_entry->wireless_mode = WIRELESS_MODE_A;
-                       if (sta->ht_cap.ht_supported == true)
+                       if (sta->ht_cap.ht_supported)
                                sta_entry->wireless_mode = WIRELESS_MODE_N_24G;
                }
 
index 0b562322f13890b58f71ec37197c401cadf66c3f..3fc21f60bb0494d8cb49c0f2cc4e2a60cc62c49d 100644 (file)
@@ -382,7 +382,7 @@ bool efuse_shadow_update_chk(struct ieee80211_hw *hw)
                        }
                }
 
-               if (wordchanged == true)
+               if (wordchanged)
                        hdr_num++;
        }
 
@@ -453,7 +453,7 @@ bool efuse_shadow_update(struct ieee80211_hw *hw)
                base = offset * 8;
 
                for (i = 0; i < 8; i++) {
-                       if (first_pg == true) {
+                       if (first_pg) {
 
                                word_en &= ~(BIT(i / 2));
 
@@ -505,7 +505,7 @@ void rtl_efuse_shadow_map_update(struct ieee80211_hw *hw)
        struct rtl_priv *rtlpriv = rtl_priv(hw);
        struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
 
-       if (rtlefuse->autoload_failflag == true)
+       if (rtlefuse->autoload_failflag)
                memset(&rtlefuse->efuse_map[EFUSE_INIT_MAP][0], 0xFF,
                        rtlpriv->cfg->maps[EFUSE_HWSET_MAX_SIZE]);
        else
@@ -690,7 +690,7 @@ static void efuse_read_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr,
                        }
                }
 
-               if (dataempty == true) {
+               if (dataempty) {
                        *readstate = PG_STATE_DATA;
                } else {
                        *efuse_addr = *efuse_addr + (word_cnts * 2) + 1;
index 3eb039a05286dd85b9cf63867c31b3a73bef2dc8..a693feffbe72913a28411ffbff05d07a1748fce7 100644 (file)
@@ -90,7 +90,7 @@ bool rtl_ps_set_rf_state(struct ieee80211_hw *hw,
                ppsc->rfoff_reason &= (~changesource);
 
                if ((changesource == RF_CHANGE_BY_HW) &&
-                   (ppsc->hwradiooff == true)) {
+                   (ppsc->hwradiooff)) {
                        ppsc->hwradiooff = false;
                }
 
index 30da68a7778643676bd3a897173c7176ebbb2da1..539df66dce0a9ed9252e3984c5c1c9e5b9cbe123 100644 (file)
@@ -200,7 +200,7 @@ static void rtl_tx_status(void *ppriv,
        if (sta) {
                /* Check if aggregation has to be enabled for this tid */
                sta_entry = (struct rtl_sta_info *) sta->drv_priv;
-               if ((sta->ht_cap.ht_supported == true) &&
+               if ((sta->ht_cap.ht_supported) &&
                                !(skb->protocol == cpu_to_be16(ETH_P_PAE))) {
                        if (ieee80211_is_data_qos(fc)) {
                                u8 tid = rtl_get_tid(skb);
index 57d52e914f1fbdcf45dc6b1165f98160cf2797b9..a00774e7090d58fc9d783c56a5184e56db18c2d0 100644 (file)
@@ -474,7 +474,7 @@ static void rtl92c_dm_ctrl_initgain_by_twoport(struct ieee80211_hw *hw)
 {
        struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
 
-       if (mac->act_scanning == true)
+       if (mac->act_scanning)
                return;
 
        if (mac->link_state >= MAC80211_LINKED)
index 944f55e9d316724ab86e3727033b5e537655ff43..bc6ae9dcf940d94c123a62613b2b40efdaeb1e16 100644 (file)
@@ -488,7 +488,7 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
        case HW_VAR_CORRECT_TSF:{
                        u8 btype_ibss = ((u8 *) (val))[0];
 
-                       if (btype_ibss == true)
+                       if (btype_ibss)
                                _rtl92ce_stop_tx_beacon(hw);
 
                        _rtl92ce_set_bcn_ctrl_reg(hw, 0, BIT(3));
@@ -500,7 +500,7 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
 
                        _rtl92ce_set_bcn_ctrl_reg(hw, BIT(3), 0);
 
-                       if (btype_ibss == true)
+                       if (btype_ibss)
                                _rtl92ce_resume_tx_beacon(hw);
 
                        break;
@@ -1121,7 +1121,7 @@ void rtl92ce_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid)
        if (rtlpriv->psc.rfpwr_state != ERFON)
                return;
 
-       if (check_bssid == true) {
+       if (check_bssid) {
                reg_rcr |= (RCR_CBSSID_DATA | RCR_CBSSID_BCN);
                rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RCR,
                                              (u8 *) (&reg_rcr));
@@ -1585,7 +1585,7 @@ static void _rtl92ce_read_adapter_info(struct ieee80211_hw *hw)
                rtlefuse->autoload_failflag = false;
        }
 
-       if (rtlefuse->autoload_failflag == true)
+       if (rtlefuse->autoload_failflag)
                return;
 
        for (i = 0; i < 6; i += 2) {
@@ -1994,7 +1994,7 @@ bool rtl92ce_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 *valid)
        u1tmp = rtl_read_byte(rtlpriv, REG_GPIO_IO_SEL);
        e_rfpowerstate_toset = (u1tmp & BIT(3)) ? ERFON : ERFOFF;
 
-       if ((ppsc->hwradiooff == true) && (e_rfpowerstate_toset == ERFON)) {
+       if ((ppsc->hwradiooff) && (e_rfpowerstate_toset == ERFON)) {
                RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
                         ("GPIOChangeRF  - HW Radio ON, RF ON\n"));
 
index 9dd1ed7b64223301c1875491ed109250e1543abf..28a1a707d09ceb275f5266adc5c7e9d8d711181b 100644 (file)
@@ -84,7 +84,7 @@ void rtl92ce_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
                break;
        case LED_PIN_LED0:
                ledcfg &= 0xf0;
-               if (pcipriv->ledctl.led_opendrain == true)
+               if (pcipriv->ledctl.led_opendrain)
                        rtl_write_byte(rtlpriv, REG_LEDCFG2,
                                       (ledcfg | BIT(1) | BIT(5) | BIT(6)));
                else
index 90d0f2cf3b2746873e3af8e4539b3bf55e66be21..d3b01e6023bac8b0549a2e46c876ecd7734be3a2 100644 (file)
@@ -76,7 +76,7 @@ void rtl92ce_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw,
        if (rtlefuse->eeprom_regulatory != 0)
                turbo_scanoff = true;
 
-       if (mac->act_scanning == true) {
+       if (mac->act_scanning) {
                tx_agc[RF90_PATH_A] = 0x3f3f3f3f;
                tx_agc[RF90_PATH_B] = 0x3f3f3f3f;
 
index be375214ad9ed37cc998450f933ed2e60de8e8fb..230bbe900d8d07eacf1975fe85da3956bb8ffb62 100644 (file)
@@ -678,7 +678,7 @@ bool rtl92ce_rx_query_desc(struct ieee80211_hw *hw,
                                                    GET_RX_DESC_PAGGR(pdesc));
 
        rx_status->mactime = GET_RX_DESC_TSFL(pdesc);
-       if (phystatus == true) {
+       if (phystatus) {
                p_drvinfo = (struct rx_fwinfo_92c *)(skb->data +
                                                     stats->rx_bufshift);
 
@@ -927,7 +927,7 @@ void rtl92ce_tx_fill_cmddesc(struct ieee80211_hw *hw,
 
 void rtl92ce_set_desc(u8 *pdesc, bool istx, u8 desc_name, u8 *val)
 {
-       if (istx == true) {
+       if (istx) {
                switch (desc_name) {
                case HW_DESC_OWN:
                        wmb();
@@ -968,7 +968,7 @@ u32 rtl92ce_get_desc(u8 *p_desc, bool istx, u8 desc_name)
 {
        u32 ret = 0;
 
-       if (istx == true) {
+       if (istx) {
                switch (desc_name) {
                case HW_DESC_OWN:
                        ret = GET_TX_DESC_OWN(p_desc);
index 52e2af58c1ed983ad0a5547995e7d137657813ce..2b34764fbf731ea634e67f3fe58b86fa04a4f36d 100644 (file)
@@ -520,7 +520,7 @@ static void _rtl92cu_read_adapter_info(struct ieee80211_hw *hw)
                RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("Autoload OK\n"));
                rtlefuse->autoload_failflag = false;
        }
-       if (rtlefuse->autoload_failflag == true)
+       if (rtlefuse->autoload_failflag)
                return;
        for (i = 0; i < 6; i += 2) {
                usvalue = *(u16 *)&hwinfo[EEPROM_MAC_ADDR + i];
@@ -1594,7 +1594,7 @@ static void _rtl92cu_set_check_bssid(struct ieee80211_hw *hw,
        default:
                break;
        }
-       if (filterout_non_associated_bssid == true) {
+       if (filterout_non_associated_bssid) {
                if (IS_NORMAL_CHIP(rtlhal->version)) {
                        switch (rtlphy->current_io_type) {
                        case IO_CMD_RESUME_DM_BY_SCAN:
@@ -2155,7 +2155,7 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
        case HW_VAR_CORRECT_TSF:{
                        u8 btype_ibss = ((u8 *) (val))[0];
 
-                       if (btype_ibss == true)
+                       if (btype_ibss)
                                _rtl92cu_stop_tx_beacon(hw);
                        _rtl92cu_set_bcn_ctrl_reg(hw, 0, BIT(3));
                        rtl_write_dword(rtlpriv, REG_TSFTR, (u32)(mac->tsf &
@@ -2163,7 +2163,7 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
                        rtl_write_dword(rtlpriv, REG_TSFTR + 4,
                                        (u32)((mac->tsf >> 32) & 0xffffffff));
                        _rtl92cu_set_bcn_ctrl_reg(hw, BIT(3), 0);
-                       if (btype_ibss == true)
+                       if (btype_ibss)
                                _rtl92cu_resume_tx_beacon(hw);
                        break;
                }
index 332c74348a69595c3dba59ea139c72993e58e26f..2ff9d8314e7b318fe3d9be9bc6f8c695422d26da 100644 (file)
@@ -82,7 +82,7 @@ void rtl92cu_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
                break;
        case LED_PIN_LED0:
                ledcfg &= 0xf0;
-               if (usbpriv->ledctl.led_opendrain == true)
+               if (usbpriv->ledctl.led_opendrain)
                        rtl_write_byte(rtlpriv, REG_LEDCFG2,
                                       (ledcfg | BIT(1) | BIT(5) | BIT(6)));
                else
index c7576ec4744ecb6155e1518fb75828c9292cb6b6..1e851aae58db913ebd49cc34878b24ab7d45937d 100644 (file)
@@ -82,7 +82,7 @@ void rtl92cu_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw,
                    (rtlefuse->external_pa))
                        turbo_scanoff = true;
        }
-       if (mac->act_scanning == true) {
+       if (mac->act_scanning) {
                tx_agc[RF90_PATH_A] = 0x3f3f3f3f;
                tx_agc[RF90_PATH_B] = 0x3f3f3f3f;
                if (turbo_scanoff) {
index 3a92ba3c4a1e8d1c86495987e0d896364d4c169f..906e7aa55bc39f40eb0c3743c91a821084d5a934 100644 (file)
@@ -342,7 +342,7 @@ bool rtl92cu_rx_query_desc(struct ieee80211_hw *hw,
                                                (u8)GET_RX_DESC_RX_MCS(pdesc),
                                                (bool)GET_RX_DESC_PAGGR(pdesc));
        rx_status->mactime = GET_RX_DESC_TSFL(pdesc);
-       if (phystatus == true) {
+       if (phystatus) {
                p_drvinfo = (struct rx_fwinfo_92c *)(pdesc + RTL_RX_DESC_SIZE);
                rtl92c_translate_rx_signal_stuff(hw, skb, stats, pdesc,
                                                 p_drvinfo);
index 609c7ec7e66a2da27635550978d7dd1f36b70fb8..4203a8531ca0b0569774ad0b72e53c2af07a9d36 100644 (file)
@@ -452,7 +452,7 @@ static void _rtl92s_dm_initial_gain_sta_beforeconnect(struct ieee80211_hw *hw)
                        if (rtlpriv->psc.rfpwr_state != ERFON)
                                return;
 
-                       if (digtable.backoff_enable_flag == true)
+                       if (digtable.backoff_enable_flag)
                                rtl92s_backoff_enable_flag(hw);
                        else
                                digtable.backoff_val = DM_DIG_BACKOFF;
index 9ed5e245e942058f5d9461f1fc362471875b1c0d..13da7b3c02027fa06f44d923ddd45e79edca55d6 100644 (file)
@@ -1106,7 +1106,7 @@ void rtl92se_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid)
        if (rtlpriv->psc.rfpwr_state != ERFON)
                return;
 
-       if (check_bssid == true) {
+       if (check_bssid) {
                reg_rcr |= (RCR_CBSSID);
                rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RCR, (u8 *)(&reg_rcr));
        } else if (check_bssid == false) {
@@ -1652,7 +1652,7 @@ static void _rtl92se_read_adapter_info(struct ieee80211_hw *hw)
                rtlefuse->autoload_failflag = false;
        }
 
-       if (rtlefuse->autoload_failflag == true)
+       if (rtlefuse->autoload_failflag)
                return;
 
        _rtl8192se_get_IC_Inferiority(hw);
@@ -2302,7 +2302,7 @@ bool rtl92se_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 *valid)
 
        rfpwr_toset = _rtl92se_rf_onoff_detect(hw);
 
-       if ((ppsc->hwradiooff == true) && (rfpwr_toset == ERFON)) {
+       if ((ppsc->hwradiooff) && (rfpwr_toset == ERFON)) {
                RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
                         ("RFKILL-HW Radio ON, RF ON\n"));
 
index 6d4f666166801331bd1b93dfd76bd24c6122bb44..e3fe7c90ebf4ea661c0c0a52b75d258f01dfd981 100644 (file)
@@ -90,7 +90,7 @@ void rtl92se_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
                break;
        case LED_PIN_LED0:
                ledcfg &= 0xf0;
-               if (pcipriv->ledctl.led_opendrain == true)
+               if (pcipriv->ledctl.led_opendrain)
                        rtl_write_byte(rtlpriv, LEDCFG, (ledcfg | BIT(1)));
                else
                        rtl_write_byte(rtlpriv, LEDCFG, (ledcfg | BIT(3)));
index 7ee2daccd7d51811764f9c02e796e8a9bd74e8c2..81a5aa4370cf706f78400b3b798144c9895c3519 100644 (file)
@@ -1416,7 +1416,7 @@ static void _rtl92s_phy_set_fwcmd_io(struct ieee80211_hw *hw)
                break;
        case FW_CMD_HIGH_PWR_ENABLE:
                if ((rtlpriv->dm.dm_flag & HAL_DM_HIPWR_DISABLE) ||
-                       (rtlpriv->dm.dynamic_txpower_enable == true))
+                       rtlpriv->dm.dynamic_txpower_enable)
                        break;
 
                /* CCA threshold */
@@ -1608,7 +1608,7 @@ bool rtl92s_phy_set_fw_cmd(struct ieee80211_hw *hw, enum fwcmd_iotype fw_cmdio)
                                fw_cmdmap &= ~FW_DIG_ENABLE_CTL;
 
                        if ((rtlpriv->dm.dm_flag & HAL_DM_HIPWR_DISABLE) ||
-                           (rtlpriv->dm.dynamic_txpower_enable == true))
+                           rtlpriv->dm.dynamic_txpower_enable)
                                fw_cmdmap &= ~FW_HIGH_PWR_ENABLE_CTL;
 
                        if ((digtable.dig_ext_port_stage ==
index 1d3a48330399e37c4e4c3e8618262191a6fa227c..c6e3a4ca42f992b972a1fd60730d89efba4cd1c7 100644 (file)
@@ -410,7 +410,7 @@ void rtl92s_phy_rf6052_set_ccktxpower(struct ieee80211_hw *hw, u8 pwrlevel)
              (rtlefuse->eeprom_regulatory != 0)))
                dont_inc_cck_or_turboscanoff = true;
 
-       if (mac->act_scanning == true) {
+       if (mac->act_scanning) {
                txagc = 0x3f;
                if (dont_inc_cck_or_turboscanoff)
                        txagc = pwrlevel;
index d509cf6a1e4df4bfc9f2a4dfb27e4056a1f5b91d..cffe30851f79fee127474f90c5c0fa3a662caa99 100644 (file)
@@ -661,7 +661,7 @@ bool rtl92se_rx_query_desc(struct ieee80211_hw *hw, struct rtl_stats *stats,
 
 
        rx_status->mactime = GET_RX_STATUS_DESC_TSFL(pdesc);
-       if (phystatus == true) {
+       if (phystatus) {
                p_drvinfo = (struct rx_fwinfo *)(skb->data +
                                                 stats->rx_bufshift);
                _rtl92se_translate_rx_signal_stuff(hw, skb, stats, pdesc,
@@ -900,7 +900,7 @@ void rtl92se_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
 
 void rtl92se_set_desc(u8 *pdesc, bool istx, u8 desc_name, u8 *val)
 {
-       if (istx == true) {
+       if (istx) {
                switch (desc_name) {
                case HW_DESC_OWN:
                        wmb();
@@ -941,7 +941,7 @@ u32 rtl92se_get_desc(u8 *desc, bool istx, u8 desc_name)
 {
        u32 ret = 0;
 
-       if (istx == true) {
+       if (istx) {
                switch (desc_name) {
                case HW_DESC_OWN:
                        ret = GET_TX_DESC_OWN(desc);