drivers/net: Remove boolean comparisons to true/false
Booleans should not be compared to true or false but be directly tested or tested with !. Done via cocci script: @@ bool t; @@ - t == true + t @@ bool t; @@ - t != true + !t @@ bool t; @@ - t == false + !t @@ bool t; @@ - t != false + t Signed-off-by: Joe Perches <joe@perches.com> Reviewed-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
这个提交包含在:
@@ -272,7 +272,7 @@ static bool _rtl92s_firmware_checkready(struct ieee80211_hw *hw,
|
||||
|
||||
/* Turn On CPU */
|
||||
rtstatus = _rtl92s_firmware_enable_cpu(hw);
|
||||
if (rtstatus != true) {
|
||||
if (!rtstatus) {
|
||||
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
|
||||
"Enable CPU fail!\n");
|
||||
goto status_check_fail;
|
||||
@@ -445,14 +445,14 @@ int rtl92s_download_fw(struct ieee80211_hw *hw)
|
||||
rtstatus = _rtl92s_firmware_downloadcode(hw, puc_mappedfile,
|
||||
ul_filelength);
|
||||
|
||||
if (rtstatus != true) {
|
||||
if (!rtstatus) {
|
||||
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "fail!\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* <3> Check whether load FW process is ready */
|
||||
rtstatus = _rtl92s_firmware_checkready(hw, fwstatus);
|
||||
if (rtstatus != true) {
|
||||
if (!rtstatus) {
|
||||
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "fail!\n");
|
||||
goto fail;
|
||||
}
|
||||
|
@@ -962,7 +962,7 @@ int rtl92se_hw_init(struct ieee80211_hw *hw)
|
||||
rtlhal->fwcmd_ioparam = rtl_read_dword(rtlpriv, LBUS_ADDR_MASK);
|
||||
|
||||
/* 3. Initialize MAC/PHY Config by MACPHY_reg.txt */
|
||||
if (rtl92s_phy_mac_config(hw) != true) {
|
||||
if (!rtl92s_phy_mac_config(hw)) {
|
||||
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "MAC Config failed\n");
|
||||
return rtstatus;
|
||||
}
|
||||
@@ -972,7 +972,7 @@ int rtl92se_hw_init(struct ieee80211_hw *hw)
|
||||
rtl_write_dword(rtlpriv, CMDR, 0x37FC);
|
||||
|
||||
/* 4. Initialize BB After MAC Config PHY_reg.txt, AGC_Tab.txt */
|
||||
if (rtl92s_phy_bb_config(hw) != true) {
|
||||
if (!rtl92s_phy_bb_config(hw)) {
|
||||
RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "BB Config failed\n");
|
||||
return rtstatus;
|
||||
}
|
||||
@@ -1008,7 +1008,7 @@ int rtl92se_hw_init(struct ieee80211_hw *hw)
|
||||
else
|
||||
rtl_write_byte(rtlpriv, RF_CTRL, 0x07);
|
||||
|
||||
if (rtl92s_phy_rf_config(hw) != true) {
|
||||
if (!rtl92s_phy_rf_config(hw)) {
|
||||
RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "RF Config failed\n");
|
||||
return rtstatus;
|
||||
}
|
||||
@@ -1105,7 +1105,7 @@ void rtl92se_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid)
|
||||
if (check_bssid) {
|
||||
reg_rcr |= (RCR_CBSSID);
|
||||
rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RCR, (u8 *)(®_rcr));
|
||||
} else if (check_bssid == false) {
|
||||
} else if (!check_bssid) {
|
||||
reg_rcr &= (~RCR_CBSSID);
|
||||
rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RCR, (u8 *)(®_rcr));
|
||||
}
|
||||
@@ -2306,7 +2306,7 @@ bool rtl92se_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 *valid)
|
||||
rfpwr_toset = ERFON;
|
||||
ppsc->hwradiooff = false;
|
||||
actuallyset = true;
|
||||
} else if ((ppsc->hwradiooff == false) && (rfpwr_toset == ERFOFF)) {
|
||||
} else if ((!ppsc->hwradiooff) && (rfpwr_toset == ERFOFF)) {
|
||||
RT_TRACE(rtlpriv, COMP_RF,
|
||||
DBG_DMESG, "RFKILL-HW Radio OFF, RF OFF\n");
|
||||
|
||||
|
@@ -558,8 +558,7 @@ bool rtl92s_phy_set_rf_power_state(struct ieee80211_hw *hw,
|
||||
RT_TRACE(rtlpriv, COMP_RF, DBG_DMESG,
|
||||
"IPS Set eRf nic enable\n");
|
||||
rtstatus = rtl_ps_enable_nic(hw);
|
||||
} while ((rtstatus != true) &&
|
||||
(InitializeCount < 10));
|
||||
} while (!rtstatus && (InitializeCount < 10));
|
||||
|
||||
RT_CLEAR_PS_LEVEL(ppsc,
|
||||
RT_RF_OFF_LEVL_HALT_NIC);
|
||||
@@ -990,7 +989,7 @@ static bool _rtl92s_phy_bb_config_parafile(struct ieee80211_hw *hw)
|
||||
rtstatus = false;
|
||||
}
|
||||
|
||||
if (rtstatus != true) {
|
||||
if (!rtstatus) {
|
||||
RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
|
||||
"Write BB Reg Fail!!\n");
|
||||
goto phy_BB8190_Config_ParaFile_Fail;
|
||||
@@ -1004,7 +1003,7 @@ static bool _rtl92s_phy_bb_config_parafile(struct ieee80211_hw *hw)
|
||||
rtstatus = _rtl92s_phy_config_bb_with_pg(hw,
|
||||
BASEBAND_CONFIG_PHY_REG);
|
||||
}
|
||||
if (rtstatus != true) {
|
||||
if (!rtstatus) {
|
||||
RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
|
||||
"_rtl92s_phy_bb_config_parafile(): BB_PG Reg Fail!!\n");
|
||||
goto phy_BB8190_Config_ParaFile_Fail;
|
||||
@@ -1013,7 +1012,7 @@ static bool _rtl92s_phy_bb_config_parafile(struct ieee80211_hw *hw)
|
||||
/* 3. BB AGC table Initialization */
|
||||
rtstatus = _rtl92s_phy_config_bb(hw, BASEBAND_CONFIG_AGC_TAB);
|
||||
|
||||
if (rtstatus != true) {
|
||||
if (!rtstatus) {
|
||||
pr_err("%s(): AGC Table Fail\n", __func__);
|
||||
goto phy_BB8190_Config_ParaFile_Fail;
|
||||
}
|
||||
@@ -1270,7 +1269,7 @@ void rtl92s_phy_set_txpower(struct ieee80211_hw *hw, u8 channel)
|
||||
/* [0]:RF-A, [1]:RF-B */
|
||||
u8 cckpowerlevel[2], ofdmpowerLevel[2];
|
||||
|
||||
if (rtlefuse->txpwr_fromeprom == false)
|
||||
if (!rtlefuse->txpwr_fromeprom)
|
||||
return;
|
||||
|
||||
/* Mainly we use RF-A Tx Power to write the Tx Power registers,
|
||||
@@ -1621,7 +1620,7 @@ bool rtl92s_phy_set_fw_cmd(struct ieee80211_hw *hw, enum fwcmd_iotype fw_cmdio)
|
||||
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) {
|
||||
fw_cmdmap |= (FW_HIGH_PWR_ENABLE_CTL |
|
||||
FW_SS_CTL);
|
||||
FW_CMD_IO_SET(rtlpriv, fw_cmdmap);
|
||||
|
@@ -499,7 +499,7 @@ bool rtl92s_phy_rf6052_config(struct ieee80211_hw *hw)
|
||||
break;
|
||||
}
|
||||
|
||||
if (rtstatus != true) {
|
||||
if (!rtstatus) {
|
||||
pr_err("Radio[%d] Fail!!\n", rfpath);
|
||||
goto fail;
|
||||
}
|
||||
|
在新工单中引用
屏蔽一个用户