staging: rtl8723bs: Fix boolinit.cocci warnings
authorJeeeun Evans <jeeeunevans@gmail.com>
Fri, 17 May 2019 17:14:48 +0000 (18:14 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 May 2019 07:31:46 +0000 (09:31 +0200)
This patch removes unnecessary comparisons to bool.

Issue found by coccinelle:
drivers/staging/rtl8723bs/core/rtw_ap.c:2159:5-11: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_cmd.c:1741:7-17: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c:360:5-15: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c:360:28-39: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_mlme.c:1675:6-10: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:6766:8-21: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c:181:5-40: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_wlan_util.c:748:14-42: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_xmit.c:2429:15-47: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_xmit.c:2458:7-17: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_xmit.c:2524:8-18: WARNING: Comparison to bool
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:1653:13-36: WARNING: Comparison to bool

Signed-off-by: Jeeeun Evans <jeeeunevans@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/core/rtw_ap.c
drivers/staging/rtl8723bs/core/rtw_cmd.c
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
drivers/staging/rtl8723bs/core/rtw_mlme.c
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
drivers/staging/rtl8723bs/core/rtw_wlan_util.c
drivers/staging/rtl8723bs/core/rtw_xmit.c
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c

index d4bf054..912ac2f 100644 (file)
@@ -2156,7 +2156,7 @@ u8 ap_free_sta(
        if (!psta)
                return beacon_updated;
 
-       if (active == true) {
+       if (active) {
                /* tear down Rx AMPDU */
                send_delba(padapter, 0, psta->hwaddr);/*  recipient */
 
index ecaa769..fcd26e1 100644 (file)
@@ -1738,7 +1738,7 @@ static void rtw_chk_hi_queue_hdl(struct adapter *padapter)
                        pstapriv->tim_bitmap &= ~BIT(0);
                        pstapriv->sta_dz_bitmap &= ~BIT(0);
 
-                       if (update_tim == true)
+                       if (update_tim)
                                update_beacon(padapter, _TIM_IE_, NULL, true);
                } else {/* re check again */
                        rtw_chk_hi_queue_cmd(padapter);
index bd75bca..8eb0ff5 100644 (file)
@@ -357,7 +357,7 @@ u8 rtw_set_802_11_connect(struct adapter *padapter, u8 *bssid, struct ndis_802_1
        if (!bssid || rtw_validate_bssid(bssid) == false)
                bssid_valid = false;
 
-       if (ssid_valid == false && bssid_valid == false) {
+       if (!ssid_valid && !bssid_valid) {
                DBG_871X(FUNC_ADPT_FMT" ssid:%p, ssid_valid:%d, bssid:%p, bssid_valid:%d\n",
                        FUNC_ADPT_ARG(padapter), ssid, ssid_valid, bssid, bssid_valid);
                status = _FAIL;
index 5f78f1e..d26d8cf 100644 (file)
@@ -1672,7 +1672,7 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)
                        roam_target = pmlmepriv->roam_network;
                }
 
-               if (roam == true) {
+               if (roam) {
                        if (rtw_to_roam(adapter) > 0)
                                rtw_dec_to_roam(adapter); /* this stadel_event is caused by roaming, decrease to_roam */
                        else if (rtw_to_roam(adapter) == 0)
index 0b5bd04..65e8cba 100644 (file)
@@ -6763,7 +6763,7 @@ int rtw_chk_start_clnt_join(struct adapter *padapter, u8 *ch, u8 *bw, u8 *offset
                *offset = cur_ch_offset;
        }
 
-       return connect_allow == true ? _SUCCESS : _FAIL;
+       return connect_allow ? _SUCCESS : _FAIL;
 }
 
 /* Find union about ch, bw, ch_offset of all linked/linking interfaces */
index 5c468c5..c337a52 100644 (file)
@@ -178,7 +178,7 @@ void rtw_ps_processor(struct adapter *padapter)
        if (pwrpriv->ips_mode_req == IPS_NONE)
                goto exit;
 
-       if (rtw_pwr_unassociated_idle(padapter) == false)
+       if (!rtw_pwr_unassociated_idle(padapter))
                goto exit;
 
        if ((pwrpriv->rf_pwrstate == rf_on) && ((pwrpriv->pwr_state_check_cnts%4) == 0)) {
index fdbf967..a131d5c 100644 (file)
@@ -745,7 +745,7 @@ s16 rtw_camid_alloc(struct adapter *adapter, struct sta_info *sta, u8 kid)
                i = _rtw_camid_search(adapter, addr, kid);
                if (i >= 0) {
                        /* Fix issue that pairwise and group key have same key id. Pairwise key first, group key can overwirte group only(ex: rekey) */
-                       if (sta || _rtw_camid_is_gk(adapter, i) == true)
+                       if (sta || _rtw_camid_is_gk(adapter, i))
                                cam_id = i;
                        else
                                DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" group key id:%u the same key id as pairwise key\n"
index 2bb679e..25409ab 100644 (file)
@@ -2426,7 +2426,7 @@ sint xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_fr
                /* DBG_871X("directly xmit pspoll_triggered packet\n"); */
 
                /* pattrib->triggered = 0; */
-               if (bmcst && xmitframe_hiq_filter(pxmitframe) == true)
+               if (bmcst && xmitframe_hiq_filter(pxmitframe))
                        pattrib->qsel = 0x11;/* HIQ */
 
                return ret;
@@ -2455,7 +2455,7 @@ sint xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_fr
 
                        /* DBG_871X("enqueue, sq_len =%d, tim =%x\n", psta->sleepq_len, pstapriv->tim_bitmap); */
 
-                       if (update_tim == true) {
+                       if (update_tim) {
                                update_beacon(padapter, _TIM_IE_, NULL, true);
                        } else {
                                chk_bmc_sleepq_cmd(padapter);
@@ -2521,7 +2521,7 @@ sint xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_fr
 
                                /* DBG_871X("enqueue, sq_len =%d, tim =%x\n", psta->sleepq_len, pstapriv->tim_bitmap); */
 
-                               if (update_tim == true)
+                               if (update_tim)
                                        /* DBG_871X("sleepq_len == 1, update BCNTIM\n"); */
                                        /* upate BCN for TIM IE */
                                        update_beacon(padapter, _TIM_IE_, NULL, true);
index db553f2..12f8e3e 100644 (file)
@@ -1650,7 +1650,7 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy
        }
 
 check_need_indicate_scan_done:
-       if (true == need_indicate_scan_done)
+       if (need_indicate_scan_done)
        {
                rtw_cfg80211_surveydone_event_callback(padapter);
                rtw_cfg80211_indicate_scan_done(padapter, false);