From a0886f7303310525f032debdff85877356c9a7ab Mon Sep 17 00:00:00 2001 From: Cristina Opriceana Date: Fri, 13 Mar 2015 21:21:31 +0200 Subject: [PATCH] Staging: rtl8192u: Bool tests don't need comparisons This patch removes explicit true/false comparations to bool variables. Warning found by coccinelle: "WARNING: Comparison to bool" Signed-off-by: Cristina Opriceana Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 5 ++--- drivers/staging/rtl8192u/r8192U_core.c | 2 +- drivers/staging/rtl8192u/r819xU_firmware.c | 6 +++--- drivers/staging/rtl8192u/r819xU_phy.c | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c index 0345f1caea54..ea92fdebe5a7 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c @@ -269,7 +269,7 @@ static PTS_COMMON_INFO SearchAdmitTRStream(struct ieee80211_device *ieee, //for(dir = DIR_UP; dir <= DIR_BI_DIR; dir++) 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){ // IEEE80211_DEBUG(IEEE80211_DL_TS, "ADD:%pM, TID:%d, dir:%d\n", pRet->Addr, pRet->TSpec.f.TSInfo.field.ucTSID, pRet->TSpec.f.TSInfo.field.ucDirection); @@ -381,8 +381,7 @@ bool GetTs( } else { - if(bAddNewTs == false) - { + if (!bAddNewTs) { IEEE80211_DEBUG(IEEE80211_DL_TS, "add new TS failed(tid:%d)\n", UP); return false; } diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index b6cd7ea744ad..c6ff2f0a4dd8 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -2823,7 +2823,7 @@ static bool rtl8192_adapter_start(struct net_device *dev) } dm_initialize_txpower_tracking(dev); - if (priv->bDcut == true) { + if (priv->bDcut) { u32 i, TempCCk; u32 tmpRegA = rtl8192_QueryBBReg(dev, rOFDM0_XATxIQImbalance, bMaskDWord); for (i = 0; i < TxBBGainTableLength; i++) { diff --git a/drivers/staging/rtl8192u/r819xU_firmware.c b/drivers/staging/rtl8192u/r819xU_firmware.c index e208c899bc5e..d27b1e24ca4a 100644 --- a/drivers/staging/rtl8192u/r819xU_firmware.c +++ b/drivers/staging/rtl8192u/r819xU_firmware.c @@ -281,7 +281,7 @@ bool init_firmware(struct net_device *dev) if (rst_opt == OPT_SYSTEM_RESET) release_firmware(fw_entry); - if (rt_status != true) + if (!rt_status) goto download_firmware_fail; switch (init_step) { @@ -304,7 +304,7 @@ bool init_firmware(struct net_device *dev) /* Check Put Code OK and Turn On CPU */ rt_status = CPUcheck_maincodeok_turnonCPU(dev); - if (rt_status != true) { + if (!rt_status) { RT_TRACE(COMP_ERR, "CPUcheck_maincodeok_turnonCPU fail!\n"); goto download_firmware_fail; } @@ -318,7 +318,7 @@ bool init_firmware(struct net_device *dev) mdelay(1); rt_status = CPUcheck_firmware_ready(dev); - if (rt_status != true) { + if (!rt_status) { RT_TRACE(COMP_ERR, "CPUcheck_firmware_ready fail(%d)!\n",rt_status); goto download_firmware_fail; } diff --git a/drivers/staging/rtl8192u/r819xU_phy.c b/drivers/staging/rtl8192u/r819xU_phy.c index 084e04fd15f8..3451ec75756c 100644 --- a/drivers/staging/rtl8192u/r819xU_phy.c +++ b/drivers/staging/rtl8192u/r819xU_phy.c @@ -1099,7 +1099,7 @@ bool rtl8192_SetRFPowerState(struct net_device *dev, if (eRFPowerState == priv->ieee80211->eRFPowerState) return false; - if (priv->SetRFPowerStateInProgress == true) + if (priv->SetRFPowerStateInProgress) return false; priv->SetRFPowerStateInProgress = true; -- 2.39.5