diff options
author | Aastha Gupta <aastha.gupta4104@gmail.com> | 2017-10-08 10:24:51 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-10-18 16:07:49 +0200 |
commit | 95b3b4238581e72756505d601948f955e8baccf7 (patch) | |
tree | 12c7de20de9e4ebbf8449666e4823bd16f039324 | |
parent | 33536569fa2b4cd4cc812eb2900249d77c904160 (diff) |
staging: rtl8723bs: remove ternary operators in assignmet statments
Remove unnecessary ternary operators in assignments statments.
This patch is with the help of following Coccinelle script:
@@
expression a, b, c;
binary operator op = {==, !=, <=, >=, <, >, &&, ||};
@@
c =
- (a op b) ? true : false
+ a op b
Signed-off-by: Aastha Gupta <aastha.gupta4104@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 5 | ||||
-rw-r--r-- | drivers/staging/rtl8723bs/hal/hal_btcoex.c | 7 | ||||
-rw-r--r-- | drivers/staging/rtl8723bs/hal/hal_com.c | 6 | ||||
-rw-r--r-- | drivers/staging/rtl8723bs/hal/odm_CfoTracking.c | 2 | ||||
-rw-r--r-- | drivers/staging/rtl8723bs/hal/odm_HWConfig.c | 2 | ||||
-rw-r--r-- | drivers/staging/rtl8723bs/hal/sdio_halinit.c | 2 |
6 files changed, 11 insertions, 13 deletions
diff --git a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c index 820a061506cc..4cd9798e262a 100644 --- a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c +++ b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c @@ -1154,7 +1154,7 @@ void rtw_init_pwrctrl_priv(struct adapter *padapter) pwrctrlpriv->LpsIdleCount = 0; pwrctrlpriv->power_mgnt = padapter->registrypriv.power_mgnt;/* PS_MODE_MIN; */ - pwrctrlpriv->bLeisurePs = (PS_MODE_ACTIVE != pwrctrlpriv->power_mgnt)?true:false; + pwrctrlpriv->bLeisurePs = pwrctrlpriv->power_mgnt != PS_MODE_ACTIVE; pwrctrlpriv->bFwCurrentInPSMode = false; @@ -1325,7 +1325,8 @@ int rtw_pm_set_lps(struct adapter *padapter, u8 mode) pwrctrlpriv->LpsIdleCount = 2; pwrctrlpriv->power_mgnt = mode; - pwrctrlpriv->bLeisurePs = (PS_MODE_ACTIVE != pwrctrlpriv->power_mgnt)?true:false; + pwrctrlpriv->bLeisurePs = + pwrctrlpriv->power_mgnt != PS_MODE_ACTIVE; } } else ret = -EINVAL; diff --git a/drivers/staging/rtl8723bs/hal/hal_btcoex.c b/drivers/staging/rtl8723bs/hal/hal_btcoex.c index 86fee109e42d..d374ce961bc5 100644 --- a/drivers/staging/rtl8723bs/hal/hal_btcoex.c +++ b/drivers/staging/rtl8723bs/hal/hal_btcoex.c @@ -463,7 +463,7 @@ static u8 halbtcoutsrc_Get(void *pBtcContext, u8 getType, void *pOutBuf) break; case BTC_GET_BL_WIFI_UNDER_5G: - *pu8 = (pHalData->CurrentBandType == 1) ? true : false; + *pu8 = pHalData->CurrentBandType == 1; break; case BTC_GET_BL_WIFI_AP_MODE_ENABLE: @@ -1416,10 +1416,7 @@ u8 hal_btcoex_Initialize(struct adapter *padapter) memset(&GLBtCoexist, 0, sizeof(GLBtCoexist)); - ret1 = EXhalbtcoutsrc_InitlizeVariables((void *)padapter); - ret2 = (ret1 == true) ? true : false; - - return ret2; + return EXhalbtcoutsrc_InitlizeVariables((void *)padapter); } void hal_btcoex_PowerOnSetting(struct adapter *padapter) diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c index 03554a4156d9..dec887a5b338 100644 --- a/drivers/staging/rtl8723bs/hal/hal_com.c +++ b/drivers/staging/rtl8723bs/hal/hal_com.c @@ -1623,7 +1623,7 @@ void rtw_get_raw_rssi_info(void *sel, struct adapter *padapter) psample_pkt_rssi->pwdball, psample_pkt_rssi->pwr_all ); - isCCKrate = (psample_pkt_rssi->data_rate <= DESC_RATE11M) ? true : false; + isCCKrate = psample_pkt_rssi->data_rate <= DESC_RATE11M; if (isCCKrate) psample_pkt_rssi->mimo_singal_strength[0] = psample_pkt_rssi->pwdball; @@ -1656,7 +1656,7 @@ void rtw_dump_raw_rssi_info(struct adapter *padapter) DBG_871X("RxRate = %s, PWDBALL = %d(%%), rx_pwr_all = %d(dBm)\n", HDATA_RATE(psample_pkt_rssi->data_rate), psample_pkt_rssi->pwdball, psample_pkt_rssi->pwr_all); - isCCKrate = (psample_pkt_rssi->data_rate <= DESC_RATE11M) ? true : false; + isCCKrate = psample_pkt_rssi->data_rate <= DESC_RATE11M; if (isCCKrate) psample_pkt_rssi->mimo_singal_strength[0] = psample_pkt_rssi->pwdball; @@ -1684,7 +1684,7 @@ void rtw_store_phy_info(struct adapter *padapter, union recv_frame *prframe) struct rx_raw_rssi *psample_pkt_rssi = &padapter->recvpriv.raw_rssi_info; psample_pkt_rssi->data_rate = pattrib->data_rate; - isCCKrate = (pattrib->data_rate <= DESC_RATE11M) ? true : false; + isCCKrate = pattrib->data_rate <= DESC_RATE11M; psample_pkt_rssi->pwdball = pPhyInfo->RxPWDBAll; psample_pkt_rssi->pwr_all = pPhyInfo->RecvSignalPower; diff --git a/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c b/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c index 9cde6c66235b..71853e6f7106 100644 --- a/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c +++ b/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c @@ -23,7 +23,7 @@ static void odm_SetCrystalCap(void *pDM_VOID, u8 CrystalCap) struct adapter *Adapter = pDM_Odm->Adapter; struct hal_com_data *pHalData = GET_HAL_DATA(Adapter); - bEEPROMCheck = (pHalData->EEPROMVersion >= 0x01) ? true : false; + bEEPROMCheck = pHalData->EEPROMVersion >= 0x01; if (pCfoTrack->CrystalCap == CrystalCap) return; diff --git a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c index ba2700135b60..8dd6da8a4e26 100644 --- a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c +++ b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c @@ -106,7 +106,7 @@ static void odm_RxPhyStatus92CSeries_Parsing( u8 LNA_idx, VGA_idx; PPHY_STATUS_RPT_8192CD_T pPhyStaRpt = (PPHY_STATUS_RPT_8192CD_T)pPhyStatus; - isCCKrate = (pPktinfo->DataRate <= DESC_RATE11M) ? true : false; + isCCKrate = pPktinfo->DataRate <= DESC_RATE11M; pPhyInfo->RxMIMOSignalQuality[ODM_RF_PATH_A] = -1; pPhyInfo->RxMIMOSignalQuality[ODM_RF_PATH_B] = -1; diff --git a/drivers/staging/rtl8723bs/hal/sdio_halinit.c b/drivers/staging/rtl8723bs/hal/sdio_halinit.c index 6dfb06a49d41..63bca67f6aca 100644 --- a/drivers/staging/rtl8723bs/hal/sdio_halinit.c +++ b/drivers/staging/rtl8723bs/hal/sdio_halinit.c @@ -1020,7 +1020,7 @@ static u32 rtl8723bs_hal_init(struct adapter *padapter) rtw_btcoex_IQKNotify(padapter, true); restore_iqk_rst = (pwrpriv->bips_processing == true) ? true : false; - b2Ant = pHalData->EEPROMBluetoothAntNum == Ant_x2 ? true : false; + b2Ant = pHalData->EEPROMBluetoothAntNum == Ant_x2; PHY_IQCalibrate_8723B(padapter, false, restore_iqk_rst, b2Ant, pHalData->ant_path); pHalData->odmpriv.RFCalibrateInfo.bIQKInitialized = true; |