status = _STATS_FAILURE_;
        }
 
-       if (_STATS_SUCCESSFUL_ != status)
+       if (status != _STATS_SUCCESSFUL_)
                goto OnAssocReqFail;
 
        /*  check if the supported rate is ok */
                wpa_ie_len = 0;
        }
 
-       if (_STATS_SUCCESSFUL_ != status)
+       if (status != _STATS_SUCCESSFUL_)
                goto OnAssocReqFail;
 
        pstat->flags &= ~(WLAN_STA_WPS | WLAN_STA_MAYBE_WPS);
        spin_unlock_bh(&pstapriv->asoc_list_lock);
 
        /*  now the station is qualified to join our BSS... */
-       if ((pstat->state & WIFI_FW_ASSOC_SUCCESS) && (_STATS_SUCCESSFUL_ == status)) {
+       if ((pstat->state & WIFI_FW_ASSOC_SUCCESS) && (status == _STATS_SUCCESSFUL_)) {
                /* 1 bss_cap_update & sta_info_update */
                bss_cap_update_on_sta_join(padapter, pstat);
                sta_info_update(padapter, pstat);
 
        }
 
        /*  Decide RATRState by RSSI. */
-       if (RSSI > HighRSSIThreshForRA)
+       if (HighRSSIThreshForRA < RSSI)
                RATRState = DM_RATR_STA_HIGH;
-       else if (RSSI > LowRSSIThreshForRA)
+       else if (LowRSSIThreshForRA < RSSI)
                RATRState = DM_RATR_STA_MIDDLE;
        else
                RATRState = DM_RATR_STA_LOW;
 
        /* polling */
        do {
                value = usb_read32(padapter, LLTReg);
-               if (_LLT_NO_ACTIVE == _LLT_OP_VALUE(value))
+               if (_LLT_OP_VALUE(value) == _LLT_NO_ACTIVE)
                        break;
 
                if (count > POLLING_LLT_THRESHOLD) {
 
 {
        pmlmepriv->fw_state |= state;
        /* FOR HW integration */
-       if (_FW_UNDER_SURVEY == state)
+       if (state == _FW_UNDER_SURVEY)
                pmlmepriv->bScanInProcess = true;
 }
 
 {
        pmlmepriv->fw_state &= ~state;
        /* FOR HW integration */
-       if (_FW_UNDER_SURVEY == state)
+       if (state == _FW_UNDER_SURVEY)
                pmlmepriv->bScanInProcess = false;
 }
 
 
 
 static inline int IsFrameTypeCtrl(unsigned char *pframe)
 {
-       if (WIFI_CTRL_TYPE == GetFrameType(pframe))
+       if (GetFrameType(pframe) == WIFI_CTRL_TYPE)
                return true;
        else
                return false;
 
        enum ndis_802_11_network_infra networkType;
        int ret = 0;
 
-       if (_FAIL == rtw_pwr_wakeup(padapter)) {
+       if (!rtw_pwr_wakeup(padapter)) {
                ret = -EPERM;
                goto exit;
        }
        struct  wlan_network    *pnetwork = NULL;
        enum ndis_802_11_auth_mode      authmode;
 
-       if (_FAIL == rtw_pwr_wakeup(padapter)) {
+       if (!rtw_pwr_wakeup(padapter)) {
                ret = -1;
                goto exit;
        }
 
        RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s\n", __func__));
 
-       if (_FAIL == rtw_pwr_wakeup(padapter)) {
+       if (!rtw_pwr_wakeup(padapter)) {
                ret = -1;
                goto exit;
        }
 
        RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_,
                 ("+%s: fw_state = 0x%08x\n", __func__, get_fwstate(pmlmepriv)));
-       if (_FAIL == rtw_pwr_wakeup(padapter)) {
+       if (!rtw_pwr_wakeup(padapter)) {
                ret = -1;
                goto exit;
        }
                int probereq_wpsie_len = len;
                u8 wps_oui[4] = {0x0, 0x50, 0xf2, 0x04};
 
-               if ((_VENDOR_SPECIFIC_IE_ == probereq_wpsie[0]) &&
+               if ((probereq_wpsie[0] == _VENDOR_SPECIFIC_IE_) &&
                    (!memcmp(&probereq_wpsie[2], wps_oui, 4))) {
                        cp_sz = min(probereq_wpsie_len, MAX_WPS_IE_LEN);