&& padapter->xmitpriv.free_xmitframe_cnt < ((
                                        NR_XMITFRAME / pstapriv->asoc_list_cnt
                                ) / 2)
-                       ) {
+                       )
                                wakeup_sta_to_xmit(padapter, psta);
-                       }
                }
        }
 
 
                /*  B0 Config LDPC Coding Capability */
                if (TEST_FLAG(phtpriv_ap->ldpc_cap, LDPC_HT_ENABLE_TX) &&
-                             GET_HT_CAPABILITY_ELE_LDPC_CAP((u8 *)(&phtpriv_sta->ht_cap))) {
+                             GET_HT_CAPABILITY_ELE_LDPC_CAP((u8 *)(&phtpriv_sta->ht_cap)))
                        SET_FLAG(cur_ldpc_cap, (LDPC_HT_ENABLE_TX | LDPC_HT_CAP_TX));
-               }
 
                /*  B7 B8 B9 Config STBC setting */
                if (TEST_FLAG(phtpriv_ap->stbc_cap, STBC_HT_ENABLE_TX) &&
-                             GET_HT_CAPABILITY_ELE_RX_STBC((u8 *)(&phtpriv_sta->ht_cap))) {
+                             GET_HT_CAPABILITY_ELE_RX_STBC((u8 *)(&phtpriv_sta->ht_cap)))
                        SET_FLAG(cur_stbc_cap, (STBC_HT_ENABLE_TX | STBC_HT_CAP_TX));
-               }
        } else {
                phtpriv_sta->ampdu_enable = false;
 
 
 
 void rtw_btcoex_HaltNotify(struct adapter *padapter)
 {
-       if (!padapter->bup) {
+       if (!padapter->bup)
                return;
-       }
 
-       if (padapter->bSurpriseRemoved) {
+       if (padapter->bSurpriseRemoved)
                return;
-       }
 
        hal_btcoex_HaltNotify(padapter);
 }
 
 
        if ((pcmdpriv->padapter->hw_init_completed == false && bAllow == false)
                || atomic_read(&(pcmdpriv->cmdthd_running)) == false    /* com_thread not running */
-       ) {
+       )
                return _FAIL;
-       }
+
        return _SUCCESS;
 }
 
                        break;
                }
 
-               if (list_empty(&(pcmdpriv->cmd_queue.queue))) {
+               if (list_empty(&(pcmdpriv->cmd_queue.queue)))
                        continue;
-               }
 
                if (rtw_register_cmd_alive(padapter) != _SUCCESS)
                        continue;
 
        mutex_lock(&pwrpriv->lock);
 
-       if (pwrpriv->dtim != dtim) {
+       if (pwrpriv->dtim != dtim)
                pwrpriv->dtim = dtim;
-       }
 
        if ((pwrpriv->bFwCurrentInPSMode == true) && (pwrpriv->pwr_mode > PS_MODE_ACTIVE)) {
                u8 ps_mode = pwrpriv->pwr_mode;
 
        /* first 3 bytes in vendor specific information element are the IEEE
         * OUI of the vendor. The following byte is used a vendor specific
         * sub-type. */
-       if (elen < 4) {
+       if (elen < 4)
                return -1;
-       }
 
        oui = get_unaligned_be24(pos);
        switch (oui) {
                        elems->wpa_ie_len = elen;
                        break;
                case WME_OUI_TYPE: /* this is a Wi-Fi WME info. element */
-                       if (elen < 5) {
+                       if (elen < 5)
                                return -1;
-                       }
+
                        switch (pos[4]) {
                        case WME_OUI_SUBTYPE_INFORMATION_ELEMENT:
                        case WME_OUI_SUBTYPE_PARAMETER_ELEMENT:
                elen = *pos++;
                left -= 2;
 
-               if (elen > left) {
+               if (elen > left)
                        return ParseFailed;
-               }
 
                switch (id) {
                case WLAN_EID_SSID:
 
 {
        int ret = false;
        int value = atomic_inc_return(&dvobj->continual_io_error);
-       if (value > MAX_CONTINUAL_IO_ERR) {
+       if (value > MAX_CONTINUAL_IO_ERR)
                ret = true;
-       }
 
        return ret;
 }
 
                }
        }
 
-       if ((desired_encmode != Ndis802_11EncryptionDisabled) && (privacy == 0)) {
+       if ((desired_encmode != Ndis802_11EncryptionDisabled) && (privacy == 0))
                bselected = false;
-       }
 
        if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) {
                if (pnetwork->network.InfrastructureMode != pmlmepriv->cur_network.network.InfrastructureMode)
                msleep(20);
        }
 
-       if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) {
+       if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
                rtw_indicate_scan_done(adapter, true);
-       }
+
        pmlmeext->scan_abort = false;
 }
 
                && jiffies_to_msecs(jiffies - pmlmepriv->scan_start_time) > pmlmepriv->auto_scan_int_ms) {
 
                if (!padapter->registrypriv.wifi_spec) {
-                       if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING) == true) {
+                       if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING) == true)
                                goto exit;
-                       }
 
-                       if (pmlmepriv->LinkDetectInfo.bBusyTraffic) {
+                       if (pmlmepriv->LinkDetectInfo.bBusyTraffic)
                                goto exit;
-                       }
                }
 
                rtw_set_802_11_bssid_list_scan(padapter, NULL, 0);
        rtw_hal_get_def_var(padapter, HAL_DEF_EXPLICIT_BEAMFORMER, (u8 *)&bHwSupportBeamformer);
        rtw_hal_get_def_var(padapter, HAL_DEF_EXPLICIT_BEAMFORMEE, (u8 *)&bHwSupportBeamformee);
        CLEAR_FLAGS(phtpriv->beamform_cap);
-       if (TEST_FLAG(pregistrypriv->beamform_cap, BIT4) && bHwSupportBeamformer) {
+       if (TEST_FLAG(pregistrypriv->beamform_cap, BIT4) && bHwSupportBeamformer)
                SET_FLAG(phtpriv->beamform_cap, BEAMFORMING_HT_BEAMFORMER_ENABLE);
-       }
-       if (TEST_FLAG(pregistrypriv->beamform_cap, BIT5) && bHwSupportBeamformee) {
+
+       if (TEST_FLAG(pregistrypriv->beamform_cap, BIT5) && bHwSupportBeamformee)
                SET_FLAG(phtpriv->beamform_cap, BEAMFORMING_HT_BEAMFORMEE_ENABLE);
-       }
 }
 
 void rtw_build_wmm_ie_ht(struct adapter *padapter, u8 *out_ie, uint *pout_len)
 
        if (TEST_FLAG(phtpriv->stbc_cap, STBC_HT_ENABLE_RX)) {
                if ((channel <= 14 && pregistrypriv->rx_stbc == 0x1) || /* enable for 2.4GHz */
-                       (pregistrypriv->wifi_spec == 1)) {
+                       (pregistrypriv->wifi_spec == 1))
                        stbc_rx_enable = 1;
-               }
        }
 
        /* fill default supported_mcs_set */
        priority = pattrib->priority;
 
        psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra);
-       if (pattrib->psta != psta) {
+       if (pattrib->psta != psta)
                return;
-       }
 
-       if (!psta) {
+       if (!psta)
                return;
-       }
 
-       if (!(psta->state & _FW_LINKED)) {
+       if (!(psta->state & _FW_LINKED))
                return;
-       }
 
        phtpriv = &psta->htpriv;
 
 
 
        memset(channel_set, 0, sizeof(struct rt_channel_info)*MAX_CHANNEL_NUM);
 
-       if (ChannelPlan >= RT_CHANNEL_DOMAIN_MAX && ChannelPlan != RT_CHANNEL_DOMAIN_REALTEK_DEFINE) {
+       if (ChannelPlan >= RT_CHANNEL_DOMAIN_MAX && ChannelPlan != RT_CHANNEL_DOMAIN_REALTEK_DEFINE)
                return chanset_size;
-       }
 
        if (IsSupported24G(padapter->registrypriv.wireless_mode)) {
                b2_4GBand = true;
 
 _issue_probersp:
                if ((check_fwstate(pmlmepriv, _FW_LINKED)  &&
-                       pmlmepriv->cur_network.join_res) || check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) {
+                       pmlmepriv->cur_network.join_res) || check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))
                        issue_probersp(padapter, get_sa(pframe), is_valid_p2p_probereq);
-               }
-
        }
 
        return _SUCCESS;
 
        p = rtw_get_ie(pframe + sizeof(struct ieee80211_hdr_3addr) + _BEACON_IE_OFFSET_, WLAN_EID_EXT_SUPP_RATES, &ielen, precv_frame->u.hdr.len - sizeof(struct ieee80211_hdr_3addr) - _BEACON_IE_OFFSET_);
        if (p && ielen > 0) {
-               if ((*(p + 1 + ielen) == 0x2D) && (*(p + 2 + ielen) != 0x2D)) {
+               if ((*(p + 1 + ielen) == 0x2D) && (*(p + 2 + ielen) != 0x2D))
                        /* Invalid value 0x2D is detected in Extended Supported Rates (ESR) IE. Try to fix the IE length to avoid failed Beacon parsing. */
                        *(p + 1) = ielen - 1;
-               }
        }
 
        if (pmlmeext->sitesurvey_res.state == SCAN_PROCESS) {
                        p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _AUTH_IE_OFFSET_, WLAN_EID_CHALLENGE, (int *)&len,
                                pkt_len - WLAN_HDR_A3_LEN - _AUTH_IE_OFFSET_);
 
-                       if (p == NULL) {
+                       if (p == NULL)
                                goto authclnt_fail;
-                       }
 
                        memcpy((void *)(pmlmeinfo->chg_txt), (void *)(p + 2), len);
                        pmlmeinfo->auth_seq = 3;
        }
 
 
-       if (pkt_len < sizeof(struct ieee80211_hdr_3addr) + ie_offset) {
+       if (pkt_len < sizeof(struct ieee80211_hdr_3addr) + ie_offset)
                return _FAIL;
-       }
 
        pstat = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
        if (!pstat) {
        if (GetRetry(frame)) {
                if (token >= 0) {
                        if ((seq_ctrl == mlmeext->action_public_rxseq)
-                               && (token == mlmeext->action_public_dialog_token)) {
+                               && (token == mlmeext->action_public_dialog_token))
                                return _FAIL;
-                       }
                } else {
-                       if (seq_ctrl == mlmeext->action_public_rxseq) {
+                       if (seq_ctrl == mlmeext->action_public_rxseq)
                                return _FAIL;
-                       }
                }
        }
 
        else
                pmgntframe = rtw_alloc_xmitframe_ext(pxmitpriv);
 
-       if (pmgntframe == NULL) {
+       if (pmgntframe == NULL)
                goto exit;
-       }
 
        pxmitbuf = rtw_alloc_xmitbuf_ext(pxmitpriv);
        if (pxmitbuf == NULL) {
        u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (!pmgntframe) {
+       if (!pmgntframe)
                return;
-       }
 
        spin_lock_bh(&pmlmepriv->bcn_update_lock);
 
 
        spin_unlock_bh(&pmlmepriv->bcn_update_lock);
 
-       if ((pattrib->pktlen + TXDESC_SIZE) > 512) {
+       if ((pattrib->pktlen + TXDESC_SIZE) > 512)
                return;
-       }
 
        pattrib->last_txcmdsz = pattrib->pktlen;
 
                return;
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL) {
+       if (pmgntframe == NULL)
                return;
-       }
-
 
        /* update attribute */
        pattrib = &pmgntframe->attrib;
                for (j = 0; j < sta_bssrate_len; j++) {
                         /*  Avoid the proprietary data rate (22Mbps) of Handlink WSG-4000 AP */
                        if ((pmlmeinfo->network.SupportedRates[i]|IEEE80211_BASIC_RATE_MASK)
-                                       == (sta_bssrate[j]|IEEE80211_BASIC_RATE_MASK)) {
+                                       == (sta_bssrate[j]|IEEE80211_BASIC_RATE_MASK))
                                break;
-                       }
                }
 
-               if (j != sta_bssrate_len) {
+               if (j != sta_bssrate_len)
                        /*  the rate is supported by STA */
                        bssrate[index++] = pmlmeinfo->network.SupportedRates[i];
-               }
        }
 
        bssrate_len = index;
        __le16 le_tmp;
 
        pmgntframe = alloc_mgtxmitframe(pxmitpriv);
-       if (pmgntframe == NULL) {
+       if (pmgntframe == NULL)
                return;
-       }
 
        /* update attribute */
        pattrib = &pmgntframe->attrib;
        }
 
 
-       if (false == bxmitok) {
+       if (false == bxmitok)
                return _FAIL;
-       } else {
+       else
                return _SUCCESS;
-       }
 }
 
 /****************************************************************************
 
        len = packet_len - sizeof(struct ieee80211_hdr_3addr);
 
-       if (len > MAX_IE_SZ) {
+       if (len > MAX_IE_SZ)
                return _FAIL;
-       }
 
        memset(bssid, 0, sizeof(struct wlan_bssid_ex));
 
 
        /*  checking SSID */
        p = rtw_get_ie(bssid->IEs + ie_offset, WLAN_EID_SSID, &len, bssid->IELength - ie_offset);
-       if (p == NULL) {
+       if (p == NULL)
                return _FAIL;
-       }
 
        if (*(p + 1)) {
-               if (len > NDIS_802_11_LENGTH_SSID) {
+               if (len > NDIS_802_11_LENGTH_SSID)
                        return _FAIL;
-               }
+
                memcpy(bssid->Ssid.Ssid, (p + 2), *(p + 1));
                bssid->Ssid.SsidLength = *(p + 1);
        } else
        i = 0;
        p = rtw_get_ie(bssid->IEs + ie_offset, WLAN_EID_SUPP_RATES, &len, bssid->IELength - ie_offset);
        if (p) {
-               if (len > NDIS_802_11_LENGTH_RATES_EX) {
+               if (len > NDIS_802_11_LENGTH_RATES_EX)
                        return _FAIL;
-               }
+
                memcpy(bssid->SupportedRates, (p + 2), len);
                i = len;
        }
 
        p = rtw_get_ie(bssid->IEs + ie_offset, WLAN_EID_EXT_SUPP_RATES, &len, bssid->IELength - ie_offset);
        if (p) {
-               if (len > (NDIS_802_11_LENGTH_RATES_EX-i)) {
+               if (len > (NDIS_802_11_LENGTH_RATES_EX-i))
                        return _FAIL;
-               }
+
                memcpy(bssid->SupportedRates + i, (p + 2), len);
        }
 
                                        }
                                }
 
-                               if (tx_chk != _SUCCESS && pmlmeinfo->link_count++ == link_count_limit) {
+                               if (tx_chk != _SUCCESS && pmlmeinfo->link_count++ == link_count_limit)
                                        tx_chk = issue_nulldata_in_interrupt(padapter, NULL);
-                               }
                        }
 
                        if (rx_chk == _FAIL) {
                }
 
                if (pmlmeext->scan_abort) {
-                       {
-                               pmlmeext->sitesurvey_res.channel_idx = pmlmeext->sitesurvey_res.ch_num;
-                       }
+                       pmlmeext->sitesurvey_res.channel_idx = pmlmeext->sitesurvey_res.ch_num;
 
                        pmlmeext->scan_abort = false;/* reset */
                }
 
 u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf)
 {
-       if (send_beacon(padapter) == _FAIL) {
+       if (send_beacon(padapter) == _FAIL)
                return H2C_PARAMETERS_ERROR;
-       }
 
        /* tx bc/mc frames after update TIM */
        chk_bmc_sleepq_hdl(padapter, NULL);
 
 
        bool ret = false;
 
-       if (adapter_to_pwrctl(adapter)->bpower_saving) {
+       if (adapter_to_pwrctl(adapter)->bpower_saving)
                goto exit;
-       }
 
-       if (time_before(jiffies, adapter_to_pwrctl(adapter)->ips_deny_time)) {
+       if (time_before(jiffies, adapter_to_pwrctl(adapter)->ips_deny_time))
                goto exit;
-       }
 
        if (check_fwstate(pmlmepriv, WIFI_ASOC_STATE|WIFI_SITE_MONITOR)
                || check_fwstate(pmlmepriv, WIFI_UNDER_LINKING|WIFI_UNDER_WPS)
        mutex_lock(&adapter_to_pwrctl(padapter)->lock);
        ps_deny = rtw_ps_deny_get(padapter);
        mutex_unlock(&adapter_to_pwrctl(padapter)->lock);
-       if (ps_deny != 0) {
+       if (ps_deny != 0)
                goto exit;
-       }
 
        if (pwrpriv->bInSuspend) {/* system suspend or autosuspend */
                pdbgpriv->dbg_ps_insuspend_cnt++;
                if (pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod > 4/*2*/) {
                        if (adapter_to_pwrctl(padapter)->bLeisurePs
                            && (adapter_to_pwrctl(padapter)->pwr_mode != PS_MODE_ACTIVE)
-                           && !(hal_btcoex_IsBtControlLps(padapter))) {
+                           && !(hal_btcoex_IsBtControlLps(padapter)))
                                bLeaveLPS = true;
-                       }
                }
        }
 
        )
                return false;
 
-       if ((padapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) && !(padapter->securitypriv.binstallGrpkey)) {
+       if ((padapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) && !(padapter->securitypriv.binstallGrpkey))
                return false;
-       }
 
        if (!rtw_cfg80211_pwr_mgmt(padapter))
                return false;
        struct mlme_priv *pmlmepriv = &(Adapter->mlmepriv);
        struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(Adapter);
 
-       if (Adapter->bSurpriseRemoved) {
+       if (Adapter->bSurpriseRemoved)
                return;
-       }
 
        if (check_fwstate(pmlmepriv, _FW_LINKED)) { /* connect */
 
-               if (pwrpriv->pwr_mode == PS_MODE_ACTIVE) {
+               if (pwrpriv->pwr_mode == PS_MODE_ACTIVE)
                        return;
-               }
 
                mutex_lock(&pwrpriv->lock);
 
        u8 enqueue = 0;
        int n_assoc_iface = 0;
 
-       if (!Adapter->bup) {
+       if (!Adapter->bup)
                return;
-       }
 
-       if (Adapter->bSurpriseRemoved) {
+       if (Adapter->bSurpriseRemoved)
                return;
-       }
 
        if (check_fwstate(&(dvobj->padapters->mlmepriv), WIFI_ASOC_STATE))
                n_assoc_iface++;
                if (bReady)
                        break;
 
-               if (jiffies_to_msecs(jiffies - start_time) > 100) {
+               if (jiffies_to_msecs(jiffies - start_time) > 100)
                        break;
-               }
+
                msleep(1);
        }
 }
 
        mutex_lock(&pwrpriv->lock);
 
-       if (pwrpriv->rpwm < PS_STATE_S2) {
+       if (pwrpriv->rpwm < PS_STATE_S2)
                goto exit;
-       }
 
        pwrpriv->cpwm = PS_STATE(preportpwrstate->state);
        pwrpriv->cpwm_tog = preportpwrstate->state & PS_TOGGLE;
        padapter = dvobj->if1;
 
        mutex_lock(&pwrpriv->lock);
-       if ((pwrpriv->rpwm == pwrpriv->cpwm) || (pwrpriv->cpwm >= PS_STATE_S2)) {
+       if ((pwrpriv->rpwm == pwrpriv->cpwm) || (pwrpriv->cpwm >= PS_STATE_S2))
                goto exit;
-       }
+
        mutex_unlock(&pwrpriv->lock);
 
        if (rtw_read8(padapter, 0x100) != 0xEA) {
 
        mutex_lock(&pwrpriv->lock);
 
-       if ((pwrpriv->rpwm == pwrpriv->cpwm) || (pwrpriv->cpwm >= PS_STATE_S2)) {
+       if ((pwrpriv->rpwm == pwrpriv->cpwm) || (pwrpriv->cpwm >= PS_STATE_S2))
                goto exit;
-       }
+
        pwrpriv->brpwmtimeout = true;
        rtw_set_rpwm(padapter, pwrpriv->rpwm);
        pwrpriv->brpwmtimeout = false;
 {
        struct pwrctrl_priv *pwrpriv = from_timer(pwrpriv, t, pwr_rpwm_timer);
 
-       if ((pwrpriv->rpwm == pwrpriv->cpwm) || (pwrpriv->cpwm >= PS_STATE_S2)) {
+       if ((pwrpriv->rpwm == pwrpriv->cpwm) || (pwrpriv->cpwm >= PS_STATE_S2))
                return;
-       }
 
        _set_workitem(&pwrpriv->rpwmtimeoutwi);
 }
                pwrpriv->ips_deny_time = deny_time;
 
 
-       if (pwrpriv->ps_processing) {
+       if (pwrpriv->ps_processing)
                while (pwrpriv->ps_processing && jiffies_to_msecs(jiffies - start) <= 3000)
                        mdelay(10);
-       }
 
-       if (!(pwrpriv->bInternalAutoSuspend) && pwrpriv->bInSuspend) {
+       if (!(pwrpriv->bInternalAutoSuspend) && pwrpriv->bInSuspend)
                while (pwrpriv->bInSuspend && jiffies_to_msecs(jiffies - start) <= 3000
-               ) {
+               )
                        mdelay(10);
-               }
-       }
 
        /* System suspend is not allowed to wakeup */
        if (!(pwrpriv->bInternalAutoSuspend) && pwrpriv->bInSuspend) {
 
                                if ((IS_MCAST(prxattrib->ra) == true)  && (prxattrib->key_index != pmlmeinfo->key_index))
                                        brpt_micerror = false;
 
-                               if ((prxattrib->bdecrypted == true) && (brpt_micerror == true)) {
+                               if ((prxattrib->bdecrypted == true) && (brpt_micerror == true))
                                        rtw_handle_tkip_mic_err(adapter, (u8)IS_MCAST(prxattrib->ra));
-                               }
 
                                res = _FAIL;
 
                     !memcmp(mybssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) ||
                     (memcmp(pattrib->bssid, mybssid, ETH_ALEN))) {
 
-                       if (!bmcast) {
+                       if (!bmcast)
                                issue_deauth(adapter, pattrib->bssid, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA);
-                       }
 
                        ret = _FAIL;
                        goto exit;
                /* Offset 12 denote 2 mac address */
                nSubframe_Length = get_unaligned_be16(pdata + 12);
 
-               if (a_len < (ETHERNET_HEADER_SIZE + nSubframe_Length)) {
+               if (a_len < (ETHERNET_HEADER_SIZE + nSubframe_Length))
                        break;
-               }
 
                sub_pkt = rtw_os_alloc_msdu_pkt(prframe, nSubframe_Length, pdata);
-               if (!sub_pkt) {
+               if (!sub_pkt)
                        break;
-               }
 
                /* move the data point to data content */
                pdata += ETH_HLEN;
 
                subframes[nr_subframes++] = sub_pkt;
 
-               if (nr_subframes >= MAX_SUBFRAME_COUNT) {
+               if (nr_subframes >= MAX_SUBFRAME_COUNT)
                        break;
-               }
 
                pdata += nSubframe_Length;
                a_len -= nSubframe_Length;
                        if (padding_len == 4)
                                padding_len = 0;
 
-                       if (a_len < padding_len) {
+                       if (a_len < padding_len)
                                break;
-                       }
+
                        pdata += padding_len;
                        a_len -= padding_len;
                }
                        plist = get_next(plist);
                        list_del_init(&(prframe->u.hdr.list));
 
-                       if (SN_EQUAL(preorder_ctrl->indicate_seq, pattrib->seq_num)) {
+                       if (SN_EQUAL(preorder_ctrl->indicate_seq, pattrib->seq_num))
                                preorder_ctrl->indicate_seq = (preorder_ctrl->indicate_seq + 1) & 0xFFF;
-                       }
 
                        /* Set this as a lock to make sure that only one thread is indicating packet. */
                        /* pTS->RxIndicateState = RXTS_INDICATE_PROCESSING; */
                }
        } else { /* B/G mode */
                retval = wlanhdr_to_ethhdr(prframe);
-               if (retval != _SUCCESS) {
+               if (retval != _SUCCESS)
                        return retval;
-               }
 
                if ((padapter->bDriverStopped == false) && (padapter->bSurpriseRemoved == false)) {
                        /* indicate this recv_frame */
        }
 
        prframe = recvframe_chk_defrag(padapter, prframe);
-       if (!prframe)   {
+       if (!prframe)
                goto _recv_data_drop;
-       }
 
        prframe = portctrl(padapter, prframe);
        if (!prframe) {
 
 
        /* compare the mic */
        for (i = 0; i < 8; i++) {
-               if (pframe[hdrlen+8+plen-8+i] != message[hdrlen+8+plen-8+i]) {
+               if (pframe[hdrlen+8+plen-8+i] != message[hdrlen+8+plen-8+i])
                        res = _FAIL;
-               }
        }
        return res;
 }
        ori_len = pattrib->pkt_len-WLAN_HDR_A3_LEN+BIP_AAD_SIZE;
        BIP_AAD = rtw_zmalloc(ori_len);
 
-       if (BIP_AAD == NULL) {
+       if (BIP_AAD == NULL)
                return _FAIL;
-       }
+
        /* PKT start */
        pframe = (unsigned char *)((union recv_frame *)precvframe)->u.hdr.rx_data;
        /* mapping to wlan header */
                memcpy(&le_tmp64, p+4, 6);
                temp_ipn = le64_to_cpu(le_tmp64);
                /* BIP packet number should bigger than previous BIP packet */
-               if (temp_ipn <= pmlmeext->mgnt_80211w_IPN_rx) {
+               if (temp_ipn <= pmlmeext->mgnt_80211w_IPN_rx)
                        goto BIP_exit;
-               }
+
                /* copy key index */
                memcpy(&le_tmp, p+2, 2);
                keyid = le16_to_cpu(le_tmp);
-               if (keyid != padapter->securitypriv.dot11wBIPKeyid) {
+               if (keyid != padapter->securitypriv.dot11wBIPKeyid)
                        goto BIP_exit;
-               }
+
                /* clear the MIC field of MME to zero */
                memset(p+2+len-8, 0, 8);
 
 
                        }
                }
 
-               for (i = 0; i < 4; i++) {
+               for (i = 0; i < 4; i++)
                        pxmitpriv->wmm_para_seq[i] = inx[i];
-               }
        }
 }
 
 
        if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
                /*  Config STBC setting */
-               if (TEST_FLAG(phtpriv->stbc_cap, STBC_HT_ENABLE_TX) && GET_HT_CAPABILITY_ELE_TX_STBC(pIE->data)) {
+               if (TEST_FLAG(phtpriv->stbc_cap, STBC_HT_ENABLE_TX) && GET_HT_CAPABILITY_ELE_TX_STBC(pIE->data))
                        SET_FLAG(cur_stbc_cap, STBC_HT_ENABLE_TX);
-               }
+
                phtpriv->stbc_cap = cur_stbc_cap;
        } else {
                /*  Config LDPC Coding Capability */
-               if (TEST_FLAG(phtpriv->ldpc_cap, LDPC_HT_ENABLE_TX) && GET_HT_CAPABILITY_ELE_LDPC_CAP(pIE->data)) {
+               if (TEST_FLAG(phtpriv->ldpc_cap, LDPC_HT_ENABLE_TX) && GET_HT_CAPABILITY_ELE_LDPC_CAP(pIE->data))
                        SET_FLAG(cur_ldpc_cap, (LDPC_HT_ENABLE_TX | LDPC_HT_CAP_TX));
-               }
+
                phtpriv->ldpc_cap = cur_ldpc_cap;
 
                /*  Config STBC setting */
-               if (TEST_FLAG(phtpriv->stbc_cap, STBC_HT_ENABLE_TX) && GET_HT_CAPABILITY_ELE_RX_STBC(pIE->data)) {
+               if (TEST_FLAG(phtpriv->stbc_cap, STBC_HT_ENABLE_TX) && GET_HT_CAPABILITY_ELE_RX_STBC(pIE->data))
                        SET_FLAG(cur_stbc_cap, (STBC_HT_ENABLE_TX | STBC_HT_CAP_TX));
-               }
+
                phtpriv->stbc_cap = cur_stbc_cap;
        }
 }
 
        len = packet_len - sizeof(struct ieee80211_hdr_3addr);
 
-       if (len > MAX_IE_SZ) {
+       if (len > MAX_IE_SZ)
                return _FAIL;
-       }
 
-       if (memcmp(cur_network->network.MacAddress, pbssid, 6)) {
+       if (memcmp(cur_network->network.MacAddress, pbssid, 6))
                return true;
-       }
 
        bssid = rtw_zmalloc(sizeof(struct wlan_bssid_ex));
-       if (!bssid) {
+       if (!bssid)
                return true;
-       }
 
        if ((pmlmepriv->timeBcnInfoChkStart != 0) && (jiffies_to_msecs(jiffies - pmlmepriv->timeBcnInfoChkStart) > DISCONNECT_BY_CHK_BCN_FAIL_OBSERV_PERIOD_IN_MS)) {
                pmlmepriv->timeBcnInfoChkStart = 0;
        if (p) {
                        bcn_channel = *(p + 2);
        } else {/* In 5G, some ap do not have DSSET IE checking HT info for channel */
-                       rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, WLAN_EID_HT_OPERATION, &len, bssid->IELength - _FIXED_IE_LENGTH_);
-                       if (pht_info) {
-                                       bcn_channel = pht_info->primary_channel;
-                       } else { /* we don't find channel IE, so don't check it */
-                                       bcn_channel = Adapter->mlmeextpriv.cur_channel;
-                       }
+               rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, WLAN_EID_HT_OPERATION, &len, bssid->IELength - _FIXED_IE_LENGTH_);
+               if (pht_info)
+                       bcn_channel = pht_info->primary_channel;
+               else /* we don't find channel IE, so don't check it */
+                       bcn_channel = Adapter->mlmeextpriv.cur_channel;
        }
-       if (bcn_channel != Adapter->mlmeextpriv.cur_channel) {
+
+       if (bcn_channel != Adapter->mlmeextpriv.cur_channel)
                        goto _mismatch;
-       }
 
        /* checking SSID */
        ssid_len = 0;
        bssid->Ssid.SsidLength = ssid_len;
 
        if (memcmp(bssid->Ssid.Ssid, cur_network->network.Ssid.Ssid, 32) ||
-                       bssid->Ssid.SsidLength != cur_network->network.Ssid.SsidLength) {
-               if (bssid->Ssid.Ssid[0] != '\0' && bssid->Ssid.SsidLength != 0) { /* not hidden ssid */
+                       bssid->Ssid.SsidLength != cur_network->network.Ssid.SsidLength)
+               if (bssid->Ssid.Ssid[0] != '\0' && bssid->Ssid.SsidLength != 0) /* not hidden ssid */
                        goto _mismatch;
-               }
-       }
 
        /* check encryption info */
        val16 = rtw_get_capability((struct wlan_bssid_ex *)bssid);
        else
                bssid->Privacy = 0;
 
-       if (cur_network->network.Privacy != bssid->Privacy) {
+       if (cur_network->network.Privacy != bssid->Privacy)
                goto _mismatch;
-       }
 
        rtw_get_sec_ie(bssid->IEs, bssid->IELength, NULL, &rsn_len, NULL, &wpa_len);
 
-       if (rsn_len > 0) {
+       if (rsn_len > 0)
                encryp_protocol = ENCRYP_PROTOCOL_WPA2;
-       } else if (wpa_len > 0) {
+       else if (wpa_len > 0)
                encryp_protocol = ENCRYP_PROTOCOL_WPA;
-       } else {
+       else
                if (bssid->Privacy)
                        encryp_protocol = ENCRYP_PROTOCOL_WEP;
-       }
 
-       if (cur_network->BcnInfo.encryp_protocol != encryp_protocol) {
+       if (cur_network->BcnInfo.encryp_protocol != encryp_protocol)
                goto _mismatch;
-       }
 
        if (encryp_protocol == ENCRYP_PROTOCOL_WPA || encryp_protocol == ENCRYP_PROTOCOL_WPA2) {
                pbuf = rtw_get_wpa_ie(&bssid->IEs[12], &wpa_ielen, bssid->IELength-12);
                } else {
                        pbuf = rtw_get_wpa2_ie(&bssid->IEs[12], &wpa_ielen, bssid->IELength-12);
 
-                       if (pbuf && (wpa_ielen > 0)) {
+                       if (pbuf && (wpa_ielen > 0))
                                rtw_parse_wpa2_ie(pbuf, wpa_ielen + 2, &group_cipher,
                                                  &pairwise_cipher, &is_8021x);
-                       }
                }
 
-               if (pairwise_cipher != cur_network->BcnInfo.pairwise_cipher || group_cipher != cur_network->BcnInfo.group_cipher) {
+               if (pairwise_cipher != cur_network->BcnInfo.pairwise_cipher || group_cipher != cur_network->BcnInfo.group_cipher)
                        goto _mismatch;
-               }
 
-               if (is_8021x != cur_network->BcnInfo.is_8021x) {
+               if (is_8021x != cur_network->BcnInfo.is_8021x)
                        goto _mismatch;
-               }
        }
 
        kfree(bssid);
                                                Vender = HT_IOT_PEER_REALTEK_SOFTAP;
 
                                        if (pIE->data[4] == 2) {
-                                               if (pIE->data[6] & RT_HT_CAP_USE_JAGUAR_BCUT) {
+                                               if (pIE->data[6] & RT_HT_CAP_USE_JAGUAR_BCUT)
                                                        Vender = HT_IOT_PEER_REALTEK_JAGUAR_BCUTAP;
-                                               }
-                                               if (pIE->data[6] & RT_HT_CAP_USE_JAGUAR_CCUT) {
+
+                                               if (pIE->data[6] & RT_HT_CAP_USE_JAGUAR_CCUT)
                                                        Vender = HT_IOT_PEER_REALTEK_JAGUAR_CCUTAP;
-                                               }
                                        }
                                }
 
                        ratio_20_delay += pmlmeext->bcn_delay_ratio[i];
                        ratio_80_delay += pmlmeext->bcn_delay_ratio[i];
 
-                       if (ratio_20_delay > 20 && DrvBcnEarly == 0xff) {
+                       if (ratio_20_delay > 20 && DrvBcnEarly == 0xff)
                                DrvBcnEarly = i;
-                       }
 
-                       if (ratio_80_delay > 80 && DrvBcnTimeOut == 0xff) {
+                       if (ratio_80_delay > 80 && DrvBcnTimeOut == 0xff)
                                DrvBcnTimeOut = i;
-                       }
 
                        /* reset adaptive_early_32k cnt */
                        pmlmeext->bcn_delay_cnt[i] = 0;
        }
        spin_unlock_bh(&pdvobj->lock);
 
-       if (i > (NUM_STA-1)) {
+       if (i > (NUM_STA-1))
                psta->mac_id = NUM_STA;
-       } else {
+       else
                psta->mac_id = i;
-       }
 }
 
 void rtw_release_macid(struct adapter *padapter, struct sta_info *psta)
 
                goto exit;
        }
 
-       if (!(psta->state & _FW_LINKED)) {
+       if (!(psta->state & _FW_LINKED))
                return _FAIL;
-       }
 
        /* TODO:_lock */
        if (update_attrib_sec_info(padapter, pattrib, psta) == _FAIL) {
                        struct sta_info *psta;
 
                        psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra);
-                       if (pattrib->psta != psta) {
+                       if (pattrib->psta != psta)
                                return _FAIL;
-                       }
 
-                       if (!psta) {
+                       if (!psta)
                                return _FAIL;
-                       }
 
-                       if (!(psta->state & _FW_LINKED)) {
+                       if (!(psta->state & _FW_LINKED))
                                return _FAIL;
-                       }
 
                        if (psta) {
                                psta->sta_xmitpriv.txseq_tid[pattrib->priority]++;
                goto xmitframe_coalesce_success;
 
        /* IGTK key is not install, it may not support 802.11w */
-       if (padapter->securitypriv.binstallBIPkey != true) {
+       if (padapter->securitypriv.binstallBIPkey != true)
                goto xmitframe_coalesce_success;
-       }
+
        /* station mode doesn't need TX BIP, just ready the code */
        if (bmcst) {
                int frame_body_len;
                        else
                                psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra);
 
-                       if (!psta) {
+                       if (!psta)
                                goto xmitframe_coalesce_fail;
-                       }
 
-                       if (!(psta->state & _FW_LINKED) || !pxmitframe->buf_addr) {
+                       if (!(psta->state & _FW_LINKED) || !pxmitframe->buf_addr)
                                goto xmitframe_coalesce_fail;
-                       }
 
                        /* according 802.11-2012 standard, these five types are not robust types */
                        if (subtype == WIFI_ACTION &&
                pxmitbuf->agg_num = 0;
                pxmitbuf->pg_num = 0;
 
-               if (pxmitbuf->sctx) {
+               if (pxmitbuf->sctx)
                        rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_ALLOC);
-               }
        }
 
        return pxmitbuf;
        struct xmit_buf         *pxmitbuf;
 
        pcmdframe = rtw_alloc_xmitframe(pxmitpriv);
-       if (!pcmdframe) {
+       if (!pcmdframe)
                return NULL;
-       }
 
        pxmitbuf = __rtw_alloc_cmd_xmitbuf(pxmitpriv, buf_type);
        if (!pxmitbuf) {
                pxmitbuf->pdata = pxmitbuf->ptail = pxmitbuf->phead;
                pxmitbuf->agg_num = 1;
 
-               if (pxmitbuf->sctx) {
+               if (pxmitbuf->sctx)
                        rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_ALLOC);
-               }
        }
 
        spin_unlock_irqrestore(&pfree_queue->lock, irqL);
                pxmitbuf->agg_num = 0;
                pxmitbuf->pg_num = 0;
 
-               if (pxmitbuf->sctx) {
+               if (pxmitbuf->sctx)
                        rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_ALLOC);
-               }
        }
 
        spin_unlock_irqrestore(&pfree_xmitbuf_queue->lock, irqL);
        if (!pxmitbuf)
                return _FAIL;
 
-       if (pxmitbuf->sctx) {
+       if (pxmitbuf->sctx)
                rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_FREE);
-       }
 
        if (pxmitbuf->buf_tag == XMITBUF_CMD) {
        } else if (pxmitbuf->buf_tag == XMITBUF_MGNT) {
        signed int res = _SUCCESS;
 
        psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra);
-       if (pattrib->psta != psta) {
+       if (pattrib->psta != psta)
                return _FAIL;
-       }
 
        if (!psta) {
                res = _FAIL;
                goto exit;
        }
 
-       if (!(psta->state & _FW_LINKED)) {
+       if (!(psta->state & _FW_LINKED))
                return _FAIL;
-       }
 
        ptxservq = rtw_get_sta_pending(padapter, psta, pattrib->priority, (u8 *)(&ac_index));
 
                if (attrib->ether_type == 0x0806 ||
                    attrib->ether_type == 0x888e ||
                    attrib->dhcp_pkt
-               ) {
+               )
                        allow = true;
-               }
+
        } else if (registry->hiq_filter == RTW_HIQ_FILTER_ALLOW_ALL)
                allow = true;
        else if (registry->hiq_filter == RTW_HIQ_FILTER_DENY_ALL) {
        if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == false)
                return ret;
        psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra);
-       if (pattrib->psta != psta) {
+       if (pattrib->psta != psta)
                return false;
-       }
 
-       if (!psta) {
+       if (!psta)
                return false;
-       }
 
-       if (!(psta->state & _FW_LINKED)) {
+       if (!(psta->state & _FW_LINKED))
                return false;
-       }
 
        if (pattrib->triggered == 1) {
                if (bmcst && xmitframe_hiq_filter(pxmitframe))
        int status = 0;
 
        expire = sctx->timeout_ms ? msecs_to_jiffies(sctx->timeout_ms) : MAX_SCHEDULE_TIMEOUT;
-       if (!wait_for_completion_timeout(&sctx->done, expire)) {
+       if (!wait_for_completion_timeout(&sctx->done, expire))
                /* timeout, do something?? */
                status = RTW_SCTX_DONE_TIMEOUT;
-       } else {
+       else
                status = sctx->status;
-       }
 
        if (status == RTW_SCTX_DONE_SUCCESS)
                ret = _SUCCESS;
 
                                        else
                                                udelay(10);
 
-                                       if (pollingCount++ > maxPollingCnt) {
+                                       if (pollingCount++ > maxPollingCnt)
                                                return false;
-                                       }
+
                                } while (!bPollingBit);
 
                                break;
 
        bool bLegalChannel = true;
 
        if ((Channel <= 14) && (Channel >= 1)) {
-               if (IsSupported24G(Adapter->registrypriv.wireless_mode) == false) {
+               if (IsSupported24G(Adapter->registrypriv.wireless_mode) == false)
                        bLegalChannel = false;
-               }
        } else {
                bLegalChannel = false;
        }
        char *szScan = szStr;
 
        /*  Check input parameter. */
-       if (!szStr || !pu4bVal || !pu4bMove) {
+       if (!szStr || !pu4bVal || !pu4bMove)
                return false;
-       }
 
        /*  Initialize output. */
        *pu4bMove = 0;
 
        struct hal_com_data     *pHalData = GET_HAL_DATA(Adapter);
        u8      value = 0;
 
-       if (RfPath > ODM_RF_PATH_D) {
+       if (RfPath > ODM_RF_PATH_D)
                return 0;
-       }
 
        if (Band == BAND_ON_2_4G) {
                switch (RateSection) {
 {
        struct hal_com_data     *pHalData = GET_HAL_DATA(Adapter);
 
-       if (RfPath > ODM_RF_PATH_D) {
+       if (RfPath > ODM_RF_PATH_D)
                return;
-       }
 
        if (Band == BAND_ON_2_4G) {
                switch (RateSection) {
 
        PHY_GetRateValuesOfTxPowerByRate(padapter, RegAddr, BitMask, Data, rateIndex, PwrByRateVal, &rateNum);
 
-       if (Band != BAND_ON_2_4G && Band != BAND_ON_5G) {
+       if (Band != BAND_ON_2_4G && Band != BAND_ON_5G)
                return;
-       }
 
-       if (RfPath > ODM_RF_PATH_D) {
+       if (RfPath > ODM_RF_PATH_D)
                return;
-       }
 
-       if (TxNum > ODM_RF_PATH_D) {
+       if (TxNum > ODM_RF_PATH_D)
                return;
-       }
 
        for (i = 0; i < rateNum; ++i) {
                if (rateIndex[i] == PHY_GetRateIndexOfTxPowerByRate(MGN_VHT2SS_MCS0) ||
        u8 txPower = 0;
        u8 chnlIdx = (Channel-1);
 
-       if (HAL_IsLegalChannel(padapter, Channel) == false) {
+       if (HAL_IsLegalChannel(padapter, Channel) == false)
                chnlIdx = 0;
-       }
 
        *bIn24G = phy_GetChnlIndex(Channel, &chnlIdx);
 
                        txPower = pHalData->Index24G_BW40_Base[RFPath][chnlIdx];
 
                /*  OFDM-1T */
-               if ((MGN_6M <= Rate && Rate <= MGN_54M) && !IS_CCK_RATE(Rate)) {
+               if ((MGN_6M <= Rate && Rate <= MGN_54M) && !IS_CCK_RATE(Rate))
                        txPower += pHalData->OFDM_24G_Diff[RFPath][TX_1S];
-               }
+
                if (BandWidth == CHANNEL_WIDTH_20) { /*  BW20-1S, BW20-2S */
                        if ((MGN_MCS0 <= Rate && Rate <= MGN_MCS31) || (MGN_VHT1SS_MCS0 <= Rate && Rate <= MGN_VHT4SS_MCS9))
                                txPower += pHalData->BW20_24G_Diff[RFPath][TX_1S];
                        txPower = pHalData->Index5G_BW40_Base[RFPath][chnlIdx];
 
                /*  OFDM-1T */
-               if ((MGN_6M <= Rate && Rate <= MGN_54M) && !IS_CCK_RATE(Rate)) {
+               if ((MGN_6M <= Rate && Rate <= MGN_54M) && !IS_CCK_RATE(Rate))
                        txPower += pHalData->OFDM_5G_Diff[RFPath][TX_1S];
-               }
 
                /*  BW20-1S, BW20-2S */
                if (BandWidth == CHANNEL_WIDTH_20) {
        if (pDM_Odm->RFCalibrateInfo.TxPowerTrackControl  == false)
                return offset;
 
-       if ((Rate == MGN_1M) || (Rate == MGN_2M) || (Rate == MGN_5_5M) || (Rate == MGN_11M)) {
+       if ((Rate == MGN_1M) || (Rate == MGN_2M) || (Rate == MGN_5_5M) || (Rate == MGN_11M))
                offset = pDM_Odm->Remnant_CCKSwingIdx;
-       } else {
+       else
                offset = pDM_Odm->Remnant_OFDMSwingIdx[RFPath];
 
-       }
-
        return offset;
 }
 
                   padapter->registrypriv.RegEnableTxPowerByRate == 0)
                return 0;
 
-       if (Band != BAND_ON_2_4G && Band != BAND_ON_5G) {
+       if (Band != BAND_ON_2_4G && Band != BAND_ON_5G)
                return value;
-       }
-       if (RFPath > ODM_RF_PATH_D) {
+
+       if (RFPath > ODM_RF_PATH_D)
                return value;
-       }
-       if (TxNum >= RF_MAX_TX_NUM) {
+
+       if (TxNum >= RF_MAX_TX_NUM)
                return value;
-       }
-       if (rateIndex >= TX_PWR_BY_RATE_NUM_RATE) {
+
+       if (rateIndex >= TX_PWR_BY_RATE_NUM_RATE)
                return value;
-       }
 
        return pHalData->TxPwrByRateOffset[Band][RFPath][TxNum][rateIndex];
 
        struct hal_com_data     *pHalData = GET_HAL_DATA(padapter);
        u8 rateIndex = PHY_GetRateIndexOfTxPowerByRate(Rate);
 
-       if (Band != BAND_ON_2_4G && Band != BAND_ON_5G) {
+       if (Band != BAND_ON_2_4G && Band != BAND_ON_5G)
                return;
-       }
-       if (RFPath > ODM_RF_PATH_D) {
+
+       if (RFPath > ODM_RF_PATH_D)
                return;
-       }
-       if (TxNum >= RF_MAX_TX_NUM) {
+
+       if (TxNum >= RF_MAX_TX_NUM)
                return;
-       }
-       if (rateIndex >= TX_PWR_BY_RATE_NUM_RATE) {
+
+       if (rateIndex >= TX_PWR_BY_RATE_NUM_RATE)
                return;
-       }
 
        pHalData->TxPwrByRateOffset[Band][RFPath][TxNum][rateIndex] = Value;
 }
                channel = phy_GetChannelIndexOfTxPowerLimit(band_type, channel);
 
        if (idx_band == -1 || idx_regulation == -1 || idx_bandwidth == -1 ||
-           idx_rate_sctn == -1 || idx_channel == -1) {
-
+           idx_rate_sctn == -1 || idx_channel == -1)
                return MAX_POWER_INDEX;
-       }
 
        if (band_type == BAND_ON_2_4G) {
                s8 limits[10] = {0}; u8 i = 0;
                rateSection = 8;
        else if (eqNByte(RateSection, (u8 *)("VHT"), 3) && eqNByte(RfPath, (u8 *)("4T"), 2))
                rateSection = 9;
-       else {
+       else
                return;
-       }
-
 
        if (eqNByte(Bandwidth, (u8 *)("20M"), 3))
                bandwidth = 0;
 
 
 _ConstructBeacon:
 
-       if ((pktlen + TXDESC_SIZE) > 512) {
+       if ((pktlen + TXDESC_SIZE) > 512)
                return;
-       }
 
        *pLength = pktlen;
 
                                ratio_20_delay += pmlmeext->bcn_delay_ratio[i];
                                ratio_80_delay += pmlmeext->bcn_delay_ratio[i];
 
-                               if (ratio_20_delay > 20 && pmlmeext->DrvBcnEarly == 0xff) {
+                               if (ratio_20_delay > 20 && pmlmeext->DrvBcnEarly == 0xff)
                                        pmlmeext->DrvBcnEarly = i;
-                               }
 
-                               if (ratio_80_delay > 80 && pmlmeext->DrvBcnTimeOut == 0xff) {
+                               if (ratio_80_delay > 80 && pmlmeext->DrvBcnTimeOut == 0xff)
                                        pmlmeext->DrvBcnTimeOut = i;
-                               }
 
                                /* reset adaptive_early_32k cnt */
                                pmlmeext->bcn_delay_cnt[i] = 0;
        MaxRsvdPageBufSize = RsvdPageNum*PageSize;
 
        pcmdframe = rtw_alloc_cmdxmitframe(pxmitpriv);
-       if (!pcmdframe) {
+       if (!pcmdframe)
                return;
-       }
 
        ReservedPagePacket = pcmdframe->buf_addr;
        memset(&RsvdPageLoc, 0, sizeof(struct rsvdpage_loc));
 
        /* 2. read power_state = 0xA0[1:0] */
        tmp_ps = rtw_read8(padapter, 0xa0);
        tmp_ps &= 0x03;
-       if (tmp_ps != 0x01) {
+       if (tmp_ps != 0x01)
                pdbgpriv->dbg_downloadfw_pwr_state_cnt++;
-       }
 
        fwfilepath = "rtlwifi/rtl8723bs_nic.bin";
 
 
 static void hal_notch_filter_8723b(struct adapter *adapter, bool enable)
 {
-       if (enable) {
+       if (enable)
                rtw_write8(adapter, rOFDM0_RxDSP+1, rtw_read8(adapter, rOFDM0_RxDSP+1) | BIT1);
-       } else {
+       else
                rtw_write8(adapter, rOFDM0_RxDSP+1, rtw_read8(adapter, rOFDM0_RxDSP+1) & ~BIT1);
-       }
 }
 
 static void UpdateHalRAMask8723B(struct adapter *padapter, u32 mac_id, u8 rssi_level)
 
        u8 tmpCenterFrequencyIndex1 = pHalData->CurrentCenterFrequencyIndex1;
 
        /* check is swchnl or setbw */
-       if (!bSwitchChannel && !bSetBandWidth) {
+       if (!bSwitchChannel && !bSetBandWidth)
                return;
-       }
 
        /* skip change for channel or bandwidth is the same */
        if (bSwitchChannel) {
 
                if (
                        (padapter->bSurpriseRemoved) ||
                        (padapter->bDriverStopped)
-               ) {
+               )
                        return false;
-               }
 
                HalQueryTxOQTBufferStatus8723BSdio(padapter);
 
                                }
 
                                /*  ok to send, remove frame from queue */
-                               if (check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) == true) {
+                               if (check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) == true)
                                        if (
                                                (pxmitframe->attrib.psta->state & WIFI_SLEEP_STATE) &&
                                                (pxmitframe->attrib.triggered == 0)
-                                       ) {
+                                       )
                                                break;
-                                       }
-                               }
 
                                list_del_init(&pxmitframe->list);
                                ptxservq->qcnt--;
 
                        if ((cpwm_orig ^ cpwm_now) & 0x80)
                                break;
 
-                       if (jiffies_to_msecs(jiffies - start_time) > 100) {
+                       if (jiffies_to_msecs(jiffies - start_time) > 100)
                                break;
-                       }
+
                } while (1);
 
                rtl8723b_set_FwPwrModeInIPS_cmd(padapter, 0);
 
        adapter = intfhdl->padapter;
        psdio = &adapter_to_dvobj(adapter)->intf_data;
 
-       if (!adapter->hw_init_completed) {
+       if (!adapter->hw_init_completed)
                return _FAIL;
-       }
 
        cnt = round_up(cnt, 4);
        HalSdioGetCmdAddr8723BSdio(adapter, addr, cnt >> 2, &addr);
                        skb_reserve(recvbuf->pskb, (RECVBUFF_ALIGN_SZ - alignment));
                }
 
-               if (!recvbuf->pskb) {
+               if (!recvbuf->pskb)
                        return NULL;
-               }
        }
 
        /* 3 3. read data from rxfifo */
 
        struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
 
        bssinf_len = pnetwork->network.IELength + sizeof(struct ieee80211_hdr_3addr);
-       if (bssinf_len > MAX_BSSINFO_LEN) {
+       if (bssinf_len > MAX_BSSINFO_LEN)
                goto exit;
-       }
 
        {
                u16 wapi_len = 0;
                if (rtw_get_wapi_ie(pnetwork->network.IEs, pnetwork->network.IELength, NULL, &wapi_len) > 0)
                {
                        if (wapi_len > 0)
-                       {
                                goto exit;
-                       }
                }
        }
 
                        }
                        if (!memcmp(&(scanned->network.Ssid), &(pnetwork->Ssid), sizeof(struct ndis_802_11_ssid))
                                && !memcmp(scanned->network.MacAddress, pnetwork->MacAddress, sizeof(NDIS_802_11_MAC_ADDRESS))
-                       ) {
+                       )
                                rtw_cfg80211_inform_bss(padapter, scanned);
-                       } else {
+                       else
                                rtw_warn_on(1);
-                       }
                }
 
                if (!rtw_cfg80211_check_bss(padapter))
 
                if (!memcmp(scanned->network.MacAddress, pnetwork->MacAddress, sizeof(NDIS_802_11_MAC_ADDRESS))
                        && !memcmp(&(scanned->network.Ssid), &(pnetwork->Ssid), sizeof(struct ndis_802_11_ssid))
-               ) {
+               )
                        rtw_cfg80211_inform_bss(padapter, scanned);
-               } else {
+               else
                        rtw_warn_on(1);
-               }
        }
 
 check_bss:
                }
        }
 
-       if (false == bMatched) {
+       if (false == bMatched)
                return -EINVAL;
-       }
 
        return 0;
 }
 
        if (vht_cap) {
                max_rate = vht_data_rate;
        } else if (ht_cap) {
-               if (mcs_rate&0x8000) { /* MCS15 */
+               if (mcs_rate&0x8000) /* MCS15 */
                        max_rate = (bw_40MHz) ? ((short_GI)?300:270):((short_GI)?144:130);
-               } else { /* default MCS7 */
+               else /* default MCS7 */
                        max_rate = (bw_40MHz) ? ((short_GI)?150:135):((short_GI)?72:65);
-               }
 
                max_rate = max_rate*2;/* Mbps/2; */
        }
        }
 
        selector = *pdata;
-       if (selector < 3 && selector >= 0) {
+       if (selector < 3 && selector >= 0)
                padapter->pid[selector] = *(pdata+1);
-       }
 
 exit:
 
                                                int i;
                                                struct recv_reorder_ctrl *preorder_ctrl;
 
-                                               for (i = 0; i < 16; i++) {
+                                               for (i = 0; i < 16; i++)
                                                        preorder_ctrl = &psta->recvreorder_ctrl[i];
-                                               }
 
                                        }
                                        break;
 
                                                                plist = get_next(plist);
 
-                                                               if (extra_arg == psta->aid) {
-                                                                       for (j = 0; j < 16; j++) {
+                                                               if (extra_arg == psta->aid)
+                                                                       for (j = 0; j < 16; j++)
                                                                                preorder_ctrl = &psta->recvreorder_ctrl[j];
-                                                                       }
-                                                               }
                                                        }
                                                }
 
                                        break;
                                case 0x0c:/* dump rx/tx packet */
                                        {
-                                               if (arg == 0) {
+                                               if (arg == 0)
                                                        /* pHalData->bDumpRxPkt =extra_arg; */
                                                        rtw_hal_set_def_var(padapter, HAL_DEF_DBG_DUMP_RXPKT, &(extra_arg));
-                                               } else if (arg == 1) {
+                                               else if (arg == 1)
                                                        rtw_hal_set_def_var(padapter, HAL_DEF_DBG_DUMP_TXPKT, &(extra_arg));
-                                               }
                                        }
                                        break;
                                case 0x0e:
                                        struct registry_priv *pregpriv = &padapter->registrypriv;
                                        /*  0: disable, bit(0):enable 2.4g, bit(1):enable 5g, 0x3: enable both 2.4g and 5g */
                                        /* default is set to enable 2.4GHZ for IOT issue with bufflao's AP at 5GHZ */
-                                       if (extra_arg == 0 || extra_arg == 1 || extra_arg == 2 || extra_arg == 3) {
+                                       if (extra_arg == 0 || extra_arg == 1 || extra_arg == 2 || extra_arg == 3)
                                                pregpriv->rx_stbc = extra_arg;
-                                       }
                                }
                                break;
                                case 0x13: /* set ampdu_enable */
                                {
                                        struct registry_priv *pregpriv = &padapter->registrypriv;
                                        /*  0: disable, 0x1:enable (but wifi_spec should be 0), 0x2: force enable (don't care wifi_spec) */
-                                       if (extra_arg < 3) {
+                                       if (extra_arg < 3)
                                                pregpriv->ampdu_enable = extra_arg;
-                                       }
                                }
                                break;
                                case 0x14:
                                                /*  extra_arg : */
                                                /*  BIT0: Enable VHT LDPC Rx, BIT1: Enable VHT LDPC Tx, */
                                                /*  BIT4: Enable HT LDPC Rx, BIT5: Enable HT LDPC Tx */
-                                               if (arg == 0) {
+                                               if (arg == 0)
                                                        pregistrypriv->ldpc_cap = 0x00;
-                                               } else if (arg == 1) {
+                                               else if (arg == 1)
                                                        pregistrypriv->ldpc_cap = (u8)(extra_arg&0x33);
-                                               }
                                        }
                                        break;
                                case 0x1a:
                                                /*  extra_arg : */
                                                /*  BIT0: Enable VHT STBC Rx, BIT1: Enable VHT STBC Tx, */
                                                /*  BIT4: Enable HT STBC Rx, BIT5: Enable HT STBC Tx */
-                                               if (arg == 0) {
+                                               if (arg == 0)
                                                        pregistrypriv->stbc_cap = 0x00;
-                                               } else if (arg == 1) {
+                                               else if (arg == 1)
                                                        pregistrypriv->stbc_cap = (u8)(extra_arg&0x33);
-                                               }
                                        }
                                        break;
                                case 0x1b:
                }
        } else {
                psta = rtw_get_stainfo(pstapriv, param->sta_addr);
-               if (!psta) {
+               if (!psta)
                        /* ret = -EINVAL; */
                        goto exit;
-               }
        }
 
        if (strcmp(param->u.crypt.alg, "none") == 0 && (psta == NULL)) {
                        wep_key_len = wep_key_len <= 5 ? 5 : 13;
                        wep_total_len = wep_key_len + FIELD_OFFSET(struct ndis_802_11_wep, KeyMaterial);
                        pwep = kzalloc(wep_total_len, GFP_KERNEL);
-                       if (pwep == NULL) {
+                       if (pwep == NULL)
                                goto exit;
-                       }
 
                        pwep->KeyLength = wep_key_len;
                        pwep->Length = wep_total_len;
        if (ie_len > 0) {
                pmlmepriv->wps_beacon_ie = rtw_malloc(ie_len);
                pmlmepriv->wps_beacon_ie_len = ie_len;
-               if (pmlmepriv->wps_beacon_ie == NULL) {
+               if (pmlmepriv->wps_beacon_ie == NULL)
                        return -EINVAL;
-               }
 
                memcpy(pmlmepriv->wps_beacon_ie, param->u.bcn_ie.buf, ie_len);
 
        if (ie_len > 0) {
                pmlmepriv->wps_probe_resp_ie = rtw_malloc(ie_len);
                pmlmepriv->wps_probe_resp_ie_len = ie_len;
-               if (pmlmepriv->wps_probe_resp_ie == NULL) {
+               if (pmlmepriv->wps_probe_resp_ie == NULL)
                        return -EINVAL;
-               }
+
                memcpy(pmlmepriv->wps_probe_resp_ie, param->u.bcn_ie.buf, ie_len);
        }
 
        if (ie_len > 0) {
                pmlmepriv->wps_assoc_resp_ie = rtw_malloc(ie_len);
                pmlmepriv->wps_assoc_resp_ie_len = ie_len;
-               if (pmlmepriv->wps_assoc_resp_ie == NULL) {
+               if (pmlmepriv->wps_assoc_resp_ie == NULL)
                        return -EINVAL;
-               }
 
                memcpy(pmlmepriv->wps_assoc_resp_ie, param->u.bcn_ie.buf, ie_len);
        }
        len = wrqu->data.length;
 
        pbuf = rtw_zmalloc(len);
-       if (pbuf == NULL) {
+       if (pbuf == NULL)
                return -ENOMEM;
-       }
 
        if (copy_from_user(pbuf, wrqu->data.pointer, len)) {
                kfree(pbuf);
 
        buff = NULL;
        if (authmode == WLAN_EID_VENDOR_SPECIFIC) {
                buff = rtw_zmalloc(IW_CUSTOM_MAX);
-               if (NULL == buff) {
+               if (NULL == buff)
                        return;
-               }
+
                p = buff;
 
                p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), "ASSOCINFO(ReqIEs =");
 
                        goto netdev_open_error;
 
                status = rtw_start_drv_threads(padapter);
-               if (status == _FAIL) {
+               if (status == _FAIL)
                        goto netdev_open_error;
-               }
 
                if (padapter->intf_start)
                        padapter->intf_start(padapter);
        struct adapter *padapter = rtw_netdev_priv(pnetdev);
        struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter);
 
-       if (pwrctrlpriv->bInSuspend) {
+       if (pwrctrlpriv->bInSuspend)
                return 0;
-       }
 
        if (mutex_lock_interruptible(&(adapter_to_dvobj(padapter)->hw_init_mutex)))
                return -1;
        rtw_stop_cmd_thread(padapter);
 
        /*  wait for the latest FW to remove this condition. */
-       if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
+       if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
                hal_btcoex_SuspendNotify(padapter, 0);
-       } else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
+       else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE))
                hal_btcoex_SuspendNotify(padapter, 1);
-       }
 
        rtw_ps_deny_cancel(padapter, PS_DENY_SUSPEND);
 
-       if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
+       if (check_fwstate(pmlmepriv, WIFI_STATION_STATE))
                rtw_suspend_normal(padapter);
-       } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
+       else if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
                rtw_suspend_normal(padapter);
-       } else {
+       else
                rtw_suspend_normal(padapter);
-       }
 
        DBG_871X_LEVEL(_drv_always_, "rtw suspend success in %d ms\n",
                jiffies_to_msecs(jiffies - start_time));
        netif_device_attach(pnetdev);
        netif_carrier_on(pnetdev);
 
-       if (padapter->pid[1] != 0) {
+       if (padapter->pid[1] != 0)
                rtw_signal_process(padapter->pid[1], SIGUSR2);
-       }
 
        if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
                if (rtw_chk_roam_flags(padapter, RTW_ROAM_ON_RESUME))
                        rtw_roaming(padapter, NULL);
-
        } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
                rtw_ap_restore_network(padapter);
        }
 
        pattrib = &prframe->u.hdr.attrib;
 
        sub_skb = rtw_skb_alloc(nSubframe_Length + 12);
-       if (!sub_skb) {
+       if (!sub_skb)
                return NULL;
-       }
 
        skb_reserve(sub_skb, 12);
        skb_put_data(sub_skb, (pdata + ETH_HLEN), nSubframe_Length);
 
 
        psdpriv = sdio_get_drvdata(func);
 
-       if (!psdpriv->if1) {
+       if (!psdpriv->if1)
                return;
-       }
 
        rtw_sdio_set_irq_thd(psdpriv, current);
        sd_int_hdl(psdpriv->if1);
                goto exit;
 
        if1 = rtw_sdio_if1_init(dvobj, id);
-       if (if1 == NULL) {
+       if (if1 == NULL)
                goto free_dvobj;
-       }
 
        /* dev_alloc_name && register_netdev */
        status = rtw_drv_register_netdev(if1);
        struct adapter *padapter = psdpriv->if1;
        struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
 
-       if (padapter->bDriverStopped) {
+       if (padapter->bDriverStopped)
                return 0;
-       }
 
        if (pwrpriv->bInSuspend) {
                pdbgpriv->dbg_suspend_error_cnt++;
 
        psdiodev = pintfhdl->pintf_dev;
        psdio = &psdiodev->intf_data;
 
-       if (padapter->bSurpriseRemoved) {
+       if (padapter->bSurpriseRemoved)
                return v;
-       }
 
        func = psdio->func;
        claim_needed = rtw_sdio_claim_host_needed(func);
        psdiodev = pintfhdl->pintf_dev;
        psdio = &psdiodev->intf_data;
 
-       if (padapter->bSurpriseRemoved) {
+       if (padapter->bSurpriseRemoved)
                return err;
-       }
 
        func = psdio->func;
 
        for (i = 0; i < cnt; i++) {
                pdata[i] = sdio_readb(func, addr + i, &err);
-               if (err) {
+               if (err)
                        break;
-               }
        }
        return err;
 }
        psdiodev = pintfhdl->pintf_dev;
        psdio = &psdiodev->intf_data;
 
-       if (padapter->bSurpriseRemoved) {
+       if (padapter->bSurpriseRemoved)
                return err;
-       }
 
        func = psdio->func;
        claim_needed = rtw_sdio_claim_host_needed(func);
        psdiodev = pintfhdl->pintf_dev;
        psdio = &psdiodev->intf_data;
 
-       if (padapter->bSurpriseRemoved) {
+       if (padapter->bSurpriseRemoved)
                return err;
-       }
 
        func = psdio->func;
 
        for (i = 0; i < cnt; i++) {
                sdio_writeb(func, pdata[i], addr + i, &err);
-               if (err) {
+               if (err)
                        break;
-               }
        }
        return err;
 }
        psdiodev = pintfhdl->pintf_dev;
        psdio = &psdiodev->intf_data;
 
-       if (padapter->bSurpriseRemoved) {
+       if (padapter->bSurpriseRemoved)
                return err;
-       }
 
        func = psdio->func;
        claim_needed = rtw_sdio_claim_host_needed(func);
        psdiodev = pintfhdl->pintf_dev;
        psdio = &psdiodev->intf_data;
 
-       if (padapter->bSurpriseRemoved) {
+       if (padapter->bSurpriseRemoved)
                return v;
-       }
 
        func = psdio->func;
        claim_needed = rtw_sdio_claim_host_needed(func);
        psdiodev = pintfhdl->pintf_dev;
        psdio = &psdiodev->intf_data;
 
-       if (padapter->bSurpriseRemoved) {
+       if (padapter->bSurpriseRemoved)
                return v;
-       }
 
        func = psdio->func;
        claim_needed = rtw_sdio_claim_host_needed(func);
        psdiodev = pintfhdl->pintf_dev;
        psdio = &psdiodev->intf_data;
 
-       if (padapter->bSurpriseRemoved) {
+       if (padapter->bSurpriseRemoved)
                return;
-       }
 
        func = psdio->func;
        claim_needed = rtw_sdio_claim_host_needed(func);
        psdiodev = pintfhdl->pintf_dev;
        psdio = &psdiodev->intf_data;
 
-       if (padapter->bSurpriseRemoved) {
+       if (padapter->bSurpriseRemoved)
                return;
-       }
 
        func = psdio->func;
        claim_needed = rtw_sdio_claim_host_needed(func);
        psdiodev = pintfhdl->pintf_dev;
        psdio = &psdiodev->intf_data;
 
-       if (padapter->bSurpriseRemoved) {
+       if (padapter->bSurpriseRemoved)
                return err;
-       }
 
        func = psdio->func;
 
                for (i = 0; i < cnt; i++) {
                        *(pbuf + i) = sdio_readb(func, addr + i, &err);
 
-                       if (err) {
+                       if (err)
                                break;
-                       }
                }
                return err;
        }
        psdiodev = pintfhdl->pintf_dev;
        psdio = &psdiodev->intf_data;
 
-       if (padapter->bSurpriseRemoved) {
+       if (padapter->bSurpriseRemoved)
                return err;
-       }
+
        func = psdio->func;
        claim_needed = rtw_sdio_claim_host_needed(func);
 
        psdiodev = pintfhdl->pintf_dev;
        psdio = &psdiodev->intf_data;
 
-       if (padapter->bSurpriseRemoved) {
+       if (padapter->bSurpriseRemoved)
                return err;
-       }
 
        func = psdio->func;
 /*     size = sdio_align_size(func, cnt); */
 
                for (i = 0; i < cnt; i++) {
                        sdio_writeb(func, *(pbuf + i), addr + i, &err);
-                       if (err) {
+                       if (err)
                                break;
-                       }
                }
 
                return err;
        psdiodev = pintfhdl->pintf_dev;
        psdio = &psdiodev->intf_data;
 
-       if (padapter->bSurpriseRemoved) {
+       if (padapter->bSurpriseRemoved)
                return err;
-       }
 
        func = psdio->func;
        claim_needed = rtw_sdio_claim_host_needed(func);
 
        queue = skb_get_queue_mapping(pkt);
        if (padapter->registrypriv.wifi_spec) {
                /* No free space for Tx, tx_worker is too slow */
-               if (pxmitpriv->hwxmits[queue].accnt > WMM_XMIT_THRESHOLD) {
+               if (pxmitpriv->hwxmits[queue].accnt > WMM_XMIT_THRESHOLD)
                        netif_stop_subqueue(padapter->pnetdev, queue);
-               }
        } else {
                if (pxmitpriv->free_xmitframe_cnt <= 4) {
                        if (!netif_tx_queue_stopped(netdev_get_tx_queue(padapter->pnetdev, queue)))
        struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
        s32 res = 0;
 
-       if (rtw_if_up(padapter) == false) {
+       if (rtw_if_up(padapter) == false)
                goto drop_packet;
-       }
 
        rtw_check_xmit_resource(padapter, pkt);
 
        }
 
        res = rtw_xmit(padapter, &pkt);
-       if (res < 0) {
+       if (res < 0)
                goto drop_packet;
-       }
 
        goto exit;