staging: r8188eu: remove unncessary ternary operator
authorMichael Straube <straube.linux@gmail.com>
Tue, 5 Apr 2022 06:08:12 +0000 (08:08 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Apr 2022 14:10:32 +0000 (16:10 +0200)
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: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220405060813.8448-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_p2p.c
drivers/staging/r8188eu/core/rtw_pwrctrl.c
drivers/staging/r8188eu/core/rtw_sta_mgt.c
drivers/staging/r8188eu/core/rtw_wlan_util.c
drivers/staging/r8188eu/hal/hal_com.c
drivers/staging/r8188eu/hal/odm_HWConfig.c
drivers/staging/r8188eu/include/HalVerDef.h
drivers/staging/r8188eu/os_dep/osdep_service.c

index 1e728a03e0ac2f3c8318935bae52687a57052060..80305d128ccd5e6819eef6c5026984f36c87dd71 100644 (file)
@@ -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)
index 939909e5316f63c303a1681430b81e4e64f2ec6e..efdc7de49d495dea1779f43b12ef2c4549dfb053 100644 (file)
@@ -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;
index 91ff82f24f1f3a0b669946917afadf5c1d195449..357f98e22d8a12104b931f42a788c301c335b530 100644 (file)
@@ -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;
 
index b526715a70bc827ca9a14d5270fb791f4f62748d..84ced6a86df949f0a6a0063ee7e2679e765a3ab0 100644 (file)
@@ -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;
        }
 }
 
index 06f2a9083056c4e159b388ce5ada07d5a62b8503..7649f9919f672e1ee6d485e7fbe98ad89ec343af 100644 (file)
@@ -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) {
index 1183e4a522c0b07c0c7d4b340bbd68f01b4cf89a..54cc3d7789cd406779e217b124893818efa7d4c7 100644 (file)
@@ -65,7 +65,7 @@ static void odm_RxPhyStatus92CSeries_Parsing(struct odm_dm_struct *dm_odm,
 
        struct phy_status_rpt *pPhyStaRpt = (struct phy_status_rpt *)pPhyStatus;
 
-       isCCKrate = ((pPktinfo->Rate >= DESC92C_RATE1M) && (pPktinfo->Rate <= DESC92C_RATE11M)) ? true : false;
+       isCCKrate = pPktinfo->Rate >= DESC92C_RATE1M && pPktinfo->Rate <= DESC92C_RATE11M;
 
        if (isCCKrate) {
                u8 cck_agc_rpt;
@@ -234,7 +234,7 @@ static void odm_Process_RSSIForDM(struct odm_dm_struct *dm_odm,
        if ((!pPktinfo->bPacketMatchBSSID))
                return;
 
-       isCCKrate = ((pPktinfo->Rate >= DESC92C_RATE1M) && (pPktinfo->Rate <= DESC92C_RATE11M)) ? true : false;
+       isCCKrate = pPktinfo->Rate >= DESC92C_RATE1M && pPktinfo->Rate <= DESC92C_RATE11M;
 
        /* Smart Antenna Debug Message------------------  */
        if ((dm_odm->AntDivType == CG_TRX_HW_ANTDIV) || (dm_odm->AntDivType == CGCS_RX_HW_ANTDIV)) {
index 2bc18eabb55d88219443f74ad5d2f3bc75ff661f..56dadadb1a0f5f3515ff166f60a64fe36bf41210 100644 (file)
@@ -34,10 +34,10 @@ struct HAL_VERSION {
 
 /* HAL_CHIP_TYPE_E */
 #define IS_NORMAL_CHIP(version)                                \
-       ((GET_CVID_CHIP_TYPE(version) == NORMAL_CHIP) ? true : false)
+       (GET_CVID_CHIP_TYPE(version) == NORMAL_CHIP)
 
 /* HAL_VENDOR_E */
 #define IS_CHIP_VENDOR_TSMC(version)                   \
-       ((GET_CVID_MANUFACTUER(version) == CHIP_VENDOR_TSMC) ? true : false)
+       (GET_CVID_MANUFACTUER(version) == CHIP_VENDOR_TSMC)
 
 #endif
index fc10eefe04a9d882c98ace5c751afba59f86e9e9..6824a6ab2e369f6eb58eb1485725bf817598052e 100644 (file)
@@ -211,7 +211,7 @@ keep_ori:
  */
 inline bool rtw_cbuf_empty(struct rtw_cbuf *cbuf)
 {
-       return (cbuf->write == cbuf->read) ? true : false;
+       return cbuf->write == cbuf->read;
 }
 
 /**