Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 95b3b423 authored by Aastha Gupta's avatar Aastha Gupta Committed by Greg Kroah-Hartman
Browse files

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: default avatarAastha Gupta <aastha.gupta4104@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 33536569
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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;
+2 −5
Original line number Diff line number Diff line
@@ -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)
+3 −3
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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;

Loading