staging: rtl8723bs: core: Remove true and false comparison
PATCH v3 1/1 staging: rtl8723bs: core: Remove true and false comparison
Remove comparison to true and false in if statement. Issue found with checkpatch.pl.
CHECK: Using comparison to true is error prone
CHECK: Using comparison to false is error prone
Signed-off-by Kushal Kothari <[email protected]>
---
Changes in v2: No changes
Changes in v3: Remove unnecessary parantheses
drivers/staging/rtl8723bs/core/rtw_cmd.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
drivers/staging/rtl8723bs/core/rtw_cmd.c +8 -9
@@ -309,9 +309,8 @@ int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)if (cmd_obj->cmdcode ==GEN_CMD_CODE (_SetChannelPlan)) bAllow = true; -if ((pcmdpriv->padapter->hw_init_completed == false && bAllow == false) - ||atomic_read (&(pcmdpriv->cmdthd_running)) == false/* com_thread not running */ - ) +if ((!pcmdpriv->padapter->hw_init_completed && !bAllow) || + !atomic_read (&pcmdpriv->cmdthd_running))/* com_thread not running */ return _FAIL;return _SUCCESS;
@@ -407,7 +406,7 @@ int rtw_cmd_thread(void *context)break ; } -if ((padapter->bDriverStopped == true) || (padapter->bSurpriseRemoved == true)) { +if (padapter->bDriverStopped || padapter->bSurpriseRemoved) { netdev_dbg(padapter->pnetdev, "%s: DriverStopped(%d) SurpriseRemoved(%d) break at line %d\n", __func__, padapter->bDriverStopped,
@@ -430,7 +429,7 @@ int rtw_cmd_thread(void *context)continue ; _next: -if ((padapter->bDriverStopped == true) || (padapter->bSurpriseRemoved == true)) { +if (padapter->bDriverStopped || padapter->bSurpriseRemoved) { netdev_dbg(padapter->pnetdev, "%s: DriverStopped(%d) SurpriseRemoved(%d) break at line %d\n", __func__, padapter->bDriverStopped,
@@ -927,7 +926,7 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, struct sta_info *sta, u8 unicast_else GET_ENCRY_ALGO (psecuritypriv, sta, psetstakey_para->algorithm, false); -if (unicast_key == true) +if (unicast_key)memcpy (&psetstakey_para->key, &sta->dot118021x_UncstKey,16 );else memcpy (&psetstakey_para->key, &psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey,16 );
@@ -1283,7 +1282,7 @@ u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer) (pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod > 2)) { bEnterPS = false; -if (bBusyTraffic == true) { +if (bBusyTraffic) {if (pmlmepriv->LinkDetectInfo.TrafficTransitionCount <=4 ) pmlmepriv->LinkDetectInfo.TrafficTransitionCount =4 ;
@@ -1619,7 +1618,7 @@ static void rtw_chk_hi_queue_hdl(struct adapter *padapter)rtw_hal_get_hwreg (padapter,HW_VAR_CHK_HI_QUEUE_EMPTY , &empty); -while (false == empty &&jiffies_to_msecs (jiffies - start) < g_wait_hiq_empty) { +while (!empty &&jiffies_to_msecs (jiffies - start) < g_wait_hiq_empty) {msleep (100 );rtw_hal_get_hwreg (padapter,HW_VAR_CHK_HI_QUEUE_EMPTY , &empty); }
@@ -2054,7 +2053,7 @@ void rtw_setassocsta_cmdrsp_callback(struct adapter *padapter, struct cmd_obj *spin_lock_bh (&pmlmepriv->lock); -if ((check_fwstate (pmlmepriv,WIFI_MP_STATE ) == true) && (check_fwstate (pmlmepriv, _FW_UNDER_LINKING) == true)) +if (check_fwstate (pmlmepriv,WIFI_MP_STATE ) &&check_fwstate (pmlmepriv, _FW_UNDER_LINKING))_clr_fwstate_ (pmlmepriv, _FW_UNDER_LINKING);set_fwstate (pmlmepriv, _FW_LINKED);
Signature · 1 line
2.25.1