Commit 7893ce1e authored by Michael Straube's avatar Michael Straube Committed by Greg Kroah-Hartman
Browse files

staging: r8188eu: remove unncessary ternary operator



There are some uses of ternary operator where it explicitly sets
true or false but the condition already evaluates to true or false.
In this cases the ternary operator is redundant and can be removed.

Signed-off-by: default avatarMichael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220405060813.8448-2-straube.linux@gmail.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fc39b784
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -951,7 +951,7 @@ u32 process_p2p_devdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint le
	/* issue Device Discoverability Response */
	issue_p2p_devdisc_resp(pwdinfo, GetAddr2Ptr(pframe), status, dialogToken);

	return (status == P2P_STATUS_SUCCESS) ? true : false;
	return status == P2P_STATUS_SUCCESS;
}

u32 process_p2p_devdisc_resp(struct wifidirect_info *pwdinfo, u8 *pframe, uint len)
+2 −2
Original line number Diff line number Diff line
@@ -346,7 +346,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 = PS_MODE_ACTIVE != pwrctrlpriv->power_mgnt;

	pwrctrlpriv->bFwCurrentInPSMode = false;

@@ -422,7 +422,7 @@ int rtw_pm_set_lps(struct adapter *padapter, u8 mode)
			else
				pwrctrlpriv->LpsIdleCount = 2;
			pwrctrlpriv->power_mgnt = mode;
			pwrctrlpriv->bLeisurePs = (PS_MODE_ACTIVE != pwrctrlpriv->power_mgnt) ? true : false;
			pwrctrlpriv->bLeisurePs = PS_MODE_ACTIVE != pwrctrlpriv->power_mgnt;
		}
	} else {
		ret = -EINVAL;
+2 −2
Original line number Diff line number Diff line
@@ -470,9 +470,9 @@ u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr)
	spin_unlock_bh(&pacl_node_q->lock);

	if (pacl_list->mode == 1)/* accept unless in deny list */
		res = (match) ? false : true;
		res = !match;
	else if (pacl_list->mode == 2)/* deny unless in accept list */
		res = (match) ? true : false;
		res = match;
	else
		res = true;

+1 −1
Original line number Diff line number Diff line
@@ -1482,7 +1482,7 @@ void process_addba_req(struct adapter *padapter, u8 *paddba_req, u8 *addr)
		tid = (param >> 2) & 0x0f;
		preorder_ctrl = &psta->recvreorder_ctrl[tid];
		preorder_ctrl->indicate_seq = 0xffff;
		preorder_ctrl->enable = (pmlmeinfo->bAcceptAddbaReq) ? true : false;
		preorder_ctrl->enable = pmlmeinfo->bAcceptAddbaReq;
	}
}

+1 −1
Original line number Diff line number Diff line
@@ -267,7 +267,7 @@ static void three_out_pipe(struct adapter *adapter, bool wifi_cfg)
bool Hal_MappingOutPipe(struct adapter *adapter, u8 numoutpipe)
{
	struct registry_priv *pregistrypriv = &adapter->registrypriv;
	bool  wifi_cfg = (pregistrypriv->wifi_spec) ? true : false;
	bool wifi_cfg = pregistrypriv->wifi_spec;
	bool result = true;

	switch (numoutpipe) {
Loading