staging: rtl8723au: Don't explicitly check check_fwstate() == true
authorJes Sorensen <Jes.Sorensen@redhat.com>
Sun, 25 May 2014 20:43:04 +0000 (22:43 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 May 2014 22:14:38 +0000 (15:14 -0700)
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/core/rtw_cmd.c
drivers/staging/rtl8723au/core/rtw_ioctl_set.c
drivers/staging/rtl8723au/core/rtw_led.c
drivers/staging/rtl8723au/core/rtw_mlme_ext.c
drivers/staging/rtl8723au/core/rtw_pwrctrl.c
drivers/staging/rtl8723au/core/rtw_recv.c
drivers/staging/rtl8723au/core/rtw_xmit.c

index bf9e56229a30c3b737e7d4fa85579d8a889a9a2c..1768a94f8f7908bae04aeb08ce82fc2900c51127 100644 (file)
@@ -349,7 +349,7 @@ int rtw_sitesurvey_cmd23a(struct rtw_adapter *padapter,
        struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
        struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
 
-       if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
+       if (check_fwstate(pmlmepriv, _FW_LINKED))
                rtw_lps_ctrl_wk_cmd23a(padapter, LPS_CTRL_SCAN, 1);
 
        ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
@@ -1030,7 +1030,7 @@ static void dynamic_chk_wk_hdl(struct rtw_adapter *padapter, u8 *pbuf, int sz)
        pmlmepriv = &padapter->mlmepriv;
 
 #ifdef CONFIG_8723AU_AP_MODE
-       if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
+       if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
                expire_timeout_chk23a(padapter);
 #endif
 
@@ -1055,8 +1055,8 @@ static void lps_ctrl_wk_hdl(struct rtw_adapter *padapter, u8 lps_ctrl_type)
        struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
        u8 mstatus;
 
-       if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) ||
-           (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true))
+       if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) ||
+           check_fwstate(pmlmepriv, WIFI_ADHOC_STATE))
                return;
 
        switch (lps_ctrl_type)
@@ -1597,8 +1597,8 @@ void rtw_setassocsta_cmdrsp_callback23a(struct rtw_adapter *padapter,
 
        spin_lock_bh(&pmlmepriv->lock);
 
-       if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) &&
-           (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true))
+       if (check_fwstate(pmlmepriv, WIFI_MP_STATE) &&
+           check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
                _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
 
        set_fwstate(pmlmepriv, _FW_LINKED);
index f65443c62baf60d7319bda58715fa636481cb7ce..ff740afffbb8b828340c2ab23a739fe80ffef43c 100644 (file)
@@ -82,7 +82,7 @@ int rtw_do_join23a(struct rtw_adapter *padapter)
                        mod_timer(&pmlmepriv->assoc_timer,
                                  jiffies + msecs_to_jiffies(MAX_JOIN_TIMEOUT));
                } else {
-                       if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) {
+                       if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
                                struct wlan_bssid_ex *pdev_network;
                                /*  submit createbss_cmd to change to a
                                    ADHOC_MASTER */
@@ -175,14 +175,12 @@ int rtw_set_802_11_ssid23a(struct rtw_adapter* padapter,
        spin_lock_bh(&pmlmepriv->lock);
 
        DBG_8723A("Set SSID under fw_state = 0x%08x\n", get_fwstate(pmlmepriv));
-       if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) {
+       if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
                goto handle_tkip_countermeasure;
-       } else if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true) {
+       else if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
                goto release_mlme_lock;
-       }
 
-       if (check_fwstate(pmlmepriv, _FW_LINKED|WIFI_ADHOC_MASTER_STATE) == true)
-       {
+       if (check_fwstate(pmlmepriv, _FW_LINKED|WIFI_ADHOC_MASTER_STATE)) {
                RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
                         ("set_ssid: _FW_LINKED||WIFI_ADHOC_MASTER_STATE\n"));
 
@@ -200,12 +198,12 @@ int rtw_set_802_11_ssid23a(struct rtw_adapter* padapter,
                                        /* if in WIFI_ADHOC_MASTER_STATE | WIFI_ADHOC_STATE, create bss or rejoin again */
                                        rtw_disassoc_cmd23a(padapter, 0, true);
 
-                                       if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
+                                       if (check_fwstate(pmlmepriv, _FW_LINKED))
                                                rtw_indicate_disconnect23a(padapter);
 
                                        rtw_free_assoc_resources23a(padapter, 1);
 
-                                       if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) {
+                                       if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) {
                                                _clr_fwstate_(pmlmepriv, WIFI_ADHOC_MASTER_STATE);
                                                set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
                                        }
@@ -228,12 +226,12 @@ int rtw_set_802_11_ssid23a(struct rtw_adapter* padapter,
 
                        rtw_disassoc_cmd23a(padapter, 0, true);
 
-                       if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
+                       if (check_fwstate(pmlmepriv, _FW_LINKED))
                                rtw_indicate_disconnect23a(padapter);
 
                        rtw_free_assoc_resources23a(padapter, 1);
 
-                       if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) {
+                       if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) {
                                _clr_fwstate_(pmlmepriv, WIFI_ADHOC_MASTER_STATE);
                                set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
                        }
@@ -260,12 +258,10 @@ handle_tkip_countermeasure:
        memcpy(&pmlmepriv->assoc_ssid, ssid, sizeof(struct cfg80211_ssid));
        pmlmepriv->assoc_by_bssid = false;
 
-       if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) {
+       if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
                pmlmepriv->to_join = true;
-       }
-       else {
+       else
                status = rtw_do_join23a(padapter);
-       }
 
 release_mlme_lock:
        spin_unlock_bh(&pmlmepriv->lock);
index 68532a3b2c141f1ccee57d3284adf49b23143c6d..c4337688b206a394064c8e36844a33660690b6d2 100644 (file)
@@ -225,7 +225,7 @@ static void SwLedBlink1(struct led_8723a *pLed)
                if (pLed->BlinkTimes == 0)
                        bStopBlinking = true;
                if (bStopBlinking) {
-                       if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
+                       if (check_fwstate(pmlmepriv, _FW_LINKED)) {
                                pLed->bLedLinkBlinkInProgress = true;
                                pLed->CurrLedState = LED_BLINK_NORMAL;
                                if (pLed->bLedOn)
@@ -258,7 +258,7 @@ static void SwLedBlink1(struct led_8723a *pLed)
                if (pLed->BlinkTimes == 0)
                        bStopBlinking = true;
                if (bStopBlinking) {
-                       if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
+                       if (check_fwstate(pmlmepriv, _FW_LINKED)) {
                                pLed->bLedLinkBlinkInProgress = true;
                                pLed->CurrLedState = LED_BLINK_NORMAL;
                                if (pLed->bLedOn)
@@ -450,8 +450,7 @@ static void SwLedBlink3(struct led_8723a *pLed)
                                {
                                        SwLedOff23a(padapter, pLed);
                                }
-                               else if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
-                               {
+                               else if (check_fwstate(pmlmepriv, _FW_LINKED)) {
                                        pLed->CurrLedState = RTW_LED_ON;
                                        pLed->BlinkingLedState = RTW_LED_ON;
                                        if (!pLed->bLedOn)
@@ -499,9 +498,8 @@ static void SwLedBlink3(struct led_8723a *pLed)
                                if (padapter->pwrctrlpriv.rf_pwrstate != rf_on)
                                {
                                        SwLedOff23a(padapter, pLed);
-                               }
-                               else if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
-                               {
+                               } else if (check_fwstate(pmlmepriv,
+                                                        _FW_LINKED)) {
                                        pLed->CurrLedState = RTW_LED_ON;
                                        pLed->BlinkingLedState = RTW_LED_ON;
 
@@ -914,8 +912,8 @@ SwLedControlMode1(struct rtw_adapter *padapter, enum led_ctl_mode LedAction)
                        break;
 
                case LED_CTL_SITE_SURVEY:
-                        if ((pmlmepriv->LinkDetectInfo.bBusyTraffic) &&
-                            (check_fwstate(pmlmepriv, _FW_LINKED) == true))
+                        if (pmlmepriv->LinkDetectInfo.bBusyTraffic &&
+                            check_fwstate(pmlmepriv, _FW_LINKED))
                                ;
                         else if (pLed->bLedScanBlinkInProgress == false) {
                                if (IS_LED_WPS_BLINKING(pLed))
@@ -1118,8 +1116,8 @@ SwLedControlMode2(struct rtw_adapter *padapter, enum led_ctl_mode LedAction)
                 break;
        case LED_CTL_TX:
        case LED_CTL_RX:
-               if ((pLed->bLedBlinkInProgress == false) &&
-                   (check_fwstate(pmlmepriv, _FW_LINKED) == true)) {
+               if (pLed->bLedBlinkInProgress == false &&
+                   check_fwstate(pmlmepriv, _FW_LINKED)) {
                        if (pLed->CurrLedState == LED_BLINK_SCAN ||
                            IS_LED_WPS_BLINKING(pLed)) {
                                return;
@@ -1261,8 +1259,8 @@ SwLedControlMode3(struct rtw_adapter *padapter, enum led_ctl_mode LedAction)
 
                case LED_CTL_TX:
                case LED_CTL_RX:
-                       if ((pLed->bLedBlinkInProgress == false) &&
-                           (check_fwstate(pmlmepriv, _FW_LINKED) == true)) {
+                       if (pLed->bLedBlinkInProgress == false &&
+                           check_fwstate(pmlmepriv, _FW_LINKED)) {
                                if (pLed->CurrLedState == LED_BLINK_SCAN ||
                                    IS_LED_WPS_BLINKING(pLed)) {
                                        return;
@@ -1477,8 +1475,8 @@ SwLedControlMode4(struct rtw_adapter *padapter, enum led_ctl_mode LedAction)
                        break;
 
                case LED_CTL_SITE_SURVEY:
-                       if ((pmlmepriv->LinkDetectInfo.bBusyTraffic) &&
-                           (check_fwstate(pmlmepriv, _FW_LINKED) == true))
+                       if (pmlmepriv->LinkDetectInfo.bBusyTraffic &&
+                           check_fwstate(pmlmepriv, _FW_LINKED))
                                ;
                        else if (pLed->bLedScanBlinkInProgress == false) {
                                if (IS_LED_WPS_BLINKING(pLed))
@@ -1714,7 +1712,8 @@ SwLedControlMode5(struct rtw_adapter *padapter, enum led_ctl_mode LedAction)
                        break;
 
                case LED_CTL_SITE_SURVEY:
-                       if ((pmlmepriv->LinkDetectInfo.bBusyTraffic) && (check_fwstate(pmlmepriv, _FW_LINKED) == true))
+                       if (pmlmepriv->LinkDetectInfo.bBusyTraffic &&
+                           check_fwstate(pmlmepriv, _FW_LINKED))
                                ;
                        else if (pLed->bLedScanBlinkInProgress == false)
                        {
index b0f218b4ca2fe6ea5870a41a9efa3901e5907018..aaadd8d19df310618b78f03b081b1c9768671fe8 100644 (file)
@@ -643,7 +643,7 @@ void mgt_dispatcher23a(struct rtw_adapter *padapter,
        switch (stype)
        {
        case IEEE80211_STYPE_AUTH:
-               if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
+               if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
                        ptable->func = &OnAuth23a;
                else
                        ptable->func = &OnAuth23aClient23a;
@@ -653,7 +653,7 @@ void mgt_dispatcher23a(struct rtw_adapter *padapter,
                _mgt_dispatcher23a(padapter, ptable, precv_frame);
                break;
        case IEEE80211_STYPE_PROBE_REQ:
-               if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
+               if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
                        _mgt_dispatcher23a(padapter, ptable, precv_frame);
                else
                        _mgt_dispatcher23a(padapter, ptable, precv_frame);
@@ -662,7 +662,7 @@ void mgt_dispatcher23a(struct rtw_adapter *padapter,
                _mgt_dispatcher23a(padapter, ptable, precv_frame);
                break;
        case IEEE80211_STYPE_ACTION:
-               /* if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) */
+               /* if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) */
                _mgt_dispatcher23a(padapter, ptable, precv_frame);
                break;
        default:
@@ -1880,7 +1880,7 @@ OnDeAuth23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame)
        DBG_8723A("%s Reason code(%d)\n", __func__, reason);
 
 #ifdef CONFIG_8723AU_AP_MODE
-       if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) {
+       if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
                struct sta_info *psta;
                struct sta_priv *pstapriv = &padapter->stapriv;
 
index 8af8e572c73b27ddedee76ab1af8bde0812e71b1..54d7bfc157b1830815648f63bc4e9c8be61f6ea5 100644 (file)
@@ -300,10 +300,10 @@ static u8 PS_RDY_CHECK(struct rtw_adapter * padapter)
                return false;
 
        if (check_fwstate(pmlmepriv, _FW_LINKED) == false ||
-           check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true ||
-           check_fwstate(pmlmepriv, WIFI_AP_STATE) == true ||
-           check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true ||
-           check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)
+           check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) ||
+           check_fwstate(pmlmepriv, WIFI_AP_STATE) ||
+           check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) ||
+           check_fwstate(pmlmepriv, WIFI_ADHOC_STATE))
                return false;
        if (pwrpriv->bInSuspend)
                return false;
@@ -462,7 +462,7 @@ void LeaveAllPowerSaveMode23a(struct rtw_adapter *Adapter)
        u8 enqueue = 0;
 
        /* DBG_8723A("%s.....\n", __func__); */
-       if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
+       if (check_fwstate(pmlmepriv, _FW_LINKED))
                rtw_lps_ctrl_wk_cmd23a(Adapter, LPS_CTRL_LEAVE, enqueue);
 }
 
@@ -589,7 +589,7 @@ int _rtw_pwr_wakeup23a(struct rtw_adapter *padapter, u32 ips_deffer_ms, const ch
        }
 
        /* I think this should be check in IPS, LPS, autosuspend functions... */
-       if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
+       if (check_fwstate(pmlmepriv, _FW_LINKED)) {
                ret = _SUCCESS;
                goto exit;
        }
index 24fa28848769bafd6b2cc94d52101d2ea54dfec4..95e74552c36fcfa803d796912f62f9e4fc724dcf 100644 (file)
@@ -800,8 +800,8 @@ static int sta2sta_data_frame(struct rtw_adapter *adapter,
 
 
 
-       if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) ||
-               (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)) {
+       if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) ||
+           check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) {
 
                /*  filter packets that SA is myself or multicast or broadcast */
                if (ether_addr_equal(myhwaddr, pattrib->src)) {
@@ -824,7 +824,7 @@ static int sta2sta_data_frame(struct rtw_adapter *adapter,
                }
 
                sta_addr = pattrib->src;
-       } else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) {
+       } else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
                /*  For Station mode, sa and bssid should always be BSSID,
                    and DA is my mac-address */
                if (!ether_addr_equal(pattrib->bssid, pattrib->src)) {
@@ -837,7 +837,7 @@ static int sta2sta_data_frame(struct rtw_adapter *adapter,
 
                sta_addr = pattrib->bssid;
 
-       } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) {
+       } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
                if (bmcast) {
                        /*  For AP mode, if DA == MCAST, then BSSID should be also MCAST */
                        if (!is_multicast_ether_addr(pattrib->bssid)) {
@@ -854,7 +854,7 @@ static int sta2sta_data_frame(struct rtw_adapter *adapter,
 
                        sta_addr = pattrib->src;
                }
-       } else if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) {
+       } else if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) {
                ether_addr_copy(pattrib->dst, hdr->addr1);
                ether_addr_copy(pattrib->src, hdr->addr2);
                ether_addr_copy(pattrib->bssid, hdr->addr3);
@@ -901,9 +901,9 @@ int ap2sta_data_frame(struct rtw_adapter *adapter,
 
 
 
-       if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) &&
-           (check_fwstate(pmlmepriv, _FW_LINKED) == true ||
-            check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true)) {
+       if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) &&
+           (check_fwstate(pmlmepriv, _FW_LINKED) ||
+            check_fwstate(pmlmepriv, _FW_UNDER_LINKING))) {
 
                /* filter packets that SA is myself or multicast or broadcast */
                if (ether_addr_equal(myhwaddr, pattrib->src)) {
@@ -966,8 +966,8 @@ int ap2sta_data_frame(struct rtw_adapter *adapter,
                        goto exit;
                }
 
-       } else if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) &&
-                  (check_fwstate(pmlmepriv, _FW_LINKED) == true)) {
+       } else if (check_fwstate(pmlmepriv, WIFI_MP_STATE) &&
+                  check_fwstate(pmlmepriv, _FW_LINKED)) {
                ether_addr_copy(pattrib->dst, hdr->addr1);
                ether_addr_copy(pattrib->src, hdr->addr2);
                ether_addr_copy(pattrib->bssid, hdr->addr3);
@@ -985,7 +985,7 @@ int ap2sta_data_frame(struct rtw_adapter *adapter,
                        ret = _FAIL;
                        goto exit;
                }
-       } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) {
+       } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
                /* Special case */
                ret = RTW_RX_HANDLED;
                goto exit;
@@ -1029,7 +1029,7 @@ int sta2ap_data_frame(struct rtw_adapter *adapter,
 
 
 
-       if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) {
+       if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
                /* For AP mode, RA = BSSID, TX = STA(SRC_ADDR), A3 = DST_ADDR */
                if (!ether_addr_equal(pattrib->bssid, mybssid)) {
                        ret = _FAIL;
@@ -1589,7 +1589,7 @@ static int wlanhdr_to_ethhdr (struct recv_frame *precvframe)
                  pattrib->hdrlen,  pattrib->iv_len));
 
        pattrib->eth_type = eth_type;
-       if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true)) {
+       if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) {
                ptr += hdrlen;
                *ptr = 0x87;
                *(ptr + 1) = 0x12;
index 90604941624cc15b0152a8a061436253e1c27b7e..cdd27c47f8fd44716dda1b40df1a3b5c555d290b 100644 (file)
@@ -443,16 +443,14 @@ static int update_attrib(struct rtw_adapter *padapter,
 
        pattrib->pctrl = 0;
 
-       if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) ||
-               (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)) {
+       if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) ||
+           check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) {
                ether_addr_copy(pattrib->ra, pattrib->dst);
                ether_addr_copy(pattrib->ta, pattrib->src);
-       }
-       else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
+       } else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
                ether_addr_copy(pattrib->ra, get_bssid(pmlmepriv));
                ether_addr_copy(pattrib->ta, pattrib->src);
-       }
-       else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
+       } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
                ether_addr_copy(pattrib->ra, pattrib->dst);
                ether_addr_copy(pattrib->ta, get_bssid(pmlmepriv));
        }
@@ -510,7 +508,7 @@ static int update_attrib(struct rtw_adapter *padapter,
                                  MAC_FMT"\n", MAC_ARG(pattrib->ra)));
                        res = _FAIL;
                        goto exit;
-               } else if ((check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) &&
+               } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) &&
                           (!(psta->state & _FW_LINKED))) {
                        res = _FAIL;
                        goto exit;
@@ -897,7 +895,7 @@ static int rtw_make_wlanhdr(struct rtw_adapter *padapter, u8 *hdr,
        pwlanhdr->frame_control = cpu_to_le16(pattrib->type);
 
        if (pattrib->type & IEEE80211_FTYPE_DATA) {
-               if ((check_fwstate(pmlmepriv,  WIFI_STATION_STATE) == true)) {
+               if (check_fwstate(pmlmepriv,  WIFI_STATION_STATE)) {
                        /* to_ds = 1, fr_ds = 0; */
                        /* Data transfer to AP */
                        pwlanhdr->frame_control |=
@@ -909,8 +907,7 @@ static int rtw_make_wlanhdr(struct rtw_adapter *padapter, u8 *hdr,
                        if (pmlmepriv->qos_option)
                                qos_option = true;
 
-               }
-               else if ((check_fwstate(pmlmepriv,  WIFI_AP_STATE) == true)) {
+               } else if (check_fwstate(pmlmepriv,  WIFI_AP_STATE)) {
                        /* to_ds = 0, fr_ds = 1; */
                        pwlanhdr->frame_control |=
                                cpu_to_le16(IEEE80211_FCTL_FROMDS);
@@ -920,9 +917,8 @@ static int rtw_make_wlanhdr(struct rtw_adapter *padapter, u8 *hdr,
 
                        if (psta->qos_option)
                                qos_option = true;
-               }
-               else if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) ||
-               (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)) {
+               } else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) ||
+                          check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) {
                        ether_addr_copy(pwlanhdr->addr1, pattrib->dst);
                        ether_addr_copy(pwlanhdr->addr2, pattrib->src);
                        ether_addr_copy(pwlanhdr->addr3, get_bssid(pmlmepriv));