return -ENOTSUPP;
        }
 
-       if (ucast)
-       {
+       if (ucast) {
                psecuritypriv->ndisencryptstatus = ndisencryptstatus;
 
                /* if (psecuritypriv->dot11PrivacyAlgrthm >= _AES_) */
        }
 
        pwpa = rtw_get_wpa_ie(buf, &wpa_ielen, ielen);
-       if (pwpa && wpa_ielen > 0)
-       {
-               if (rtw_parse_wpa_ie(pwpa, wpa_ielen+2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS)
-               {
+       if (pwpa && wpa_ielen > 0) {
+               if (rtw_parse_wpa_ie(pwpa, wpa_ielen+2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) {
                        padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_8021X;
                        padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeWPAPSK;
                        memcpy(padapter->securitypriv.supplicant_ie, &pwpa[0], wpa_ielen+2);
        }
 
        pwpa2 = rtw_get_wpa2_ie(buf, &wpa2_ielen, ielen);
-       if (pwpa2 && wpa2_ielen > 0)
-       {
-               if (rtw_parse_wpa2_ie(pwpa2, wpa2_ielen+2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS)
-               {
+       if (pwpa2 && wpa2_ielen > 0) {
+               if (rtw_parse_wpa2_ie(pwpa2, wpa2_ielen+2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) {
                        padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_8021X;
                        padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeWPA2PSK;
                        memcpy(padapter->securitypriv.supplicant_ie, &pwpa2[0], wpa2_ielen+2);
        }
 
        if (group_cipher == 0)
-       {
                group_cipher = WPA_CIPHER_NONE;
-       }
+
        if (pairwise_cipher == 0)
-       {
                pairwise_cipher = WPA_CIPHER_NONE;
-       }
 
        switch (group_cipher)
        {
                goto exit;
        }
 
-       if (!params->ssid || !params->ssid_len)
-       {
+       if (!params->ssid || !params->ssid_len) {
                ret = -EINVAL;
                goto exit;
        }
        ret = rtw_cfg80211_set_auth_type(psecuritypriv, NL80211_AUTHTYPE_OPEN_SYSTEM);
        rtw_set_802_11_authentication_mode(padapter, psecuritypriv->ndisauthtype);
 
-       if (rtw_set_802_11_ssid(padapter, &ndis_ssid) == false)
-       {
+       if (rtw_set_802_11_ssid(padapter, &ndis_ssid) == false) {
                ret = -1;
                goto exit;
        }
 
        rtw_set_to_roam(padapter, 0);
 
-       if (check_fwstate(&padapter->mlmepriv, _FW_LINKED))
-       {
+       if (check_fwstate(&padapter->mlmepriv, _FW_LINKED)) {
                rtw_scan_abort(padapter);
                LeaveAllPowerSaveMode(padapter);
 
                sme->privacy, sme->key, sme->key_len, sme->key_idx);
 
 
-       if (adapter_wdev_data(padapter)->block == true)
-       {
+       if (adapter_wdev_data(padapter)->block == true) {
                ret = -EBUSY;
                DBG_871X("%s wdev_priv.block is set\n", __func__);
                goto exit;
                goto exit;
        }
 
-       if (!sme->ssid || !sme->ssid_len)
-       {
+       if (!sme->ssid || !sme->ssid_len) {
                ret = -EINVAL;
                goto exit;
        }
        }
 
        /* For WEP Shared auth */
-       if ((psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_Shared
-               || psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_Auto) && sme->key
-       )
-       {
+       if ((psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_Shared ||
+           psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_Auto) && sme->key) {
                u32 wep_key_idx, wep_key_len, wep_total_len;
                struct ndis_802_11_wep   *pwep = NULL;
                DBG_871X("%s(): Shared/Auto WEP\n", __func__);
                        goto exit;
                }
 
-               if (wep_key_len > 0)
-               {
+               if (wep_key_len > 0) {
                        wep_key_len = wep_key_len <= 5 ? 5 : 13;
                        wep_total_len = wep_key_len + FIELD_OFFSET(struct ndis_802_11_wep, KeyMaterial);
                        pwep = rtw_malloc(wep_total_len);
                        pwep->KeyLength = wep_key_len;
                        pwep->Length = wep_total_len;
 
-                       if (wep_key_len == 13)
-                       {
+                       if (wep_key_len == 13) {
                                padapter->securitypriv.dot11PrivacyAlgrthm = _WEP104_;
                                padapter->securitypriv.dot118021XGrpPrivacy = _WEP104_;
                        }
-               }
-               else {
+               } else {
                        ret = -EINVAL;
                        goto exit;
                }
                memcpy(pwep->KeyMaterial,  (void *)sme->key, pwep->KeyLength);
 
                if (rtw_set_802_11_add_wep(padapter, pwep) == (u8)_FAIL)
-               {
                        ret = -EOPNOTSUPP;
-               }
 
                kfree(pwep);
 
        DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
 
        if (!memcmp((u8 *)pmksa->bssid, strZeroMacAddress, ETH_ALEN))
-       {
                return -EINVAL;
-       }
 
        blInserted = false;
 
        /* overwrite PMKID */
-       for (index = 0 ; index < NUM_PMKID_CACHE; index++)
-       {
-               if (!memcmp(psecuritypriv->PMKIDList[index].Bssid, (u8 *)pmksa->bssid, ETH_ALEN))
-               { /*  BSSID is matched, the same AP => rewrite with new PMKID. */
+       for (index = 0 ; index < NUM_PMKID_CACHE; index++) {
+               if (!memcmp(psecuritypriv->PMKIDList[index].Bssid, (u8 *)pmksa->bssid, ETH_ALEN)) {
+                       /*  BSSID is matched, the same AP => rewrite with new PMKID. */
                        DBG_871X(FUNC_NDEV_FMT" BSSID exists in the PMKList.\n", FUNC_NDEV_ARG(ndev));
 
                        memcpy(psecuritypriv->PMKIDList[index].PMKID, (u8 *)pmksa->pmkid, WLAN_PMKID_LEN);
                }
        }
 
-       if (!blInserted)
-       {
+       if (!blInserted) {
                /*  Find a new entry */
                DBG_871X(FUNC_NDEV_FMT" Use the new entry index = %d for this PMKID.\n",
                        FUNC_NDEV_ARG(ndev), psecuritypriv->PMKIDIndex);
                psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].bUsed = true;
                psecuritypriv->PMKIDIndex++;
                if (psecuritypriv->PMKIDIndex == 16)
-               {
                        psecuritypriv->PMKIDIndex = 0;
-               }
        }
 
        return 0;
 
        DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
 
-       for (index = 0 ; index < NUM_PMKID_CACHE; index++)
-       {
-               if (!memcmp(psecuritypriv->PMKIDList[index].Bssid, (u8 *)pmksa->bssid, ETH_ALEN))
-               { /*  BSSID is matched, the same AP => Remove this PMKID information and reset it. */
+       for (index = 0 ; index < NUM_PMKID_CACHE; index++) {
+               if (!memcmp(psecuritypriv->PMKIDList[index].Bssid, (u8 *)pmksa->bssid, ETH_ALEN)) {
+                       /*
+                        * BSSID is matched, the same AP => Remove this PMKID information
+                        * and reset it.
+                        */
                        eth_zero_addr(psecuritypriv->PMKIDList[index].Bssid);
                        memset(psecuritypriv->PMKIDList[index].PMKID, 0x00, WLAN_PMKID_LEN);
                        psecuritypriv->PMKIDList[index].bUsed = false;
                }
        }
 
-       if (false == bMatched)
-       {
+       if (false == bMatched) {
                DBG_871X(FUNC_NDEV_FMT" do not have matched BSSID\n"
                        , FUNC_NDEV_ARG(ndev));
                return -EINVAL;
        if (unlikely(skb->len < rtap_len))
                goto fail;
 
-       if (rtap_len != 14)
-       {
+       if (rtap_len != 14) {
                DBG_8192C("radiotap len (should be 14): %d\n", rtap_len);
                goto fail;
        }
                /* Use the real net device to transmit the packet */
                return _rtw_xmit_entry(skb, padapter->pnetdev);
 
-       }
-       else if ((frame_control & (IEEE80211_FCTL_FTYPE|IEEE80211_FCTL_STYPE))
-               == (IEEE80211_FTYPE_MGMT|IEEE80211_STYPE_ACTION)
-       )
-       {
+       } else if ((frame_control & (IEEE80211_FCTL_FTYPE|IEEE80211_FCTL_STYPE)) ==
+                  (IEEE80211_FTYPE_MGMT|IEEE80211_STYPE_ACTION)) {
                /* only for action frames */
                struct xmit_frame               *pmgntframe;
                struct pkt_attrib       *pattrib;
 
                /* starting alloc mgmt frame to dump it */
                if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL)
-               {
                        goto fail;
-               }
 
                /* update attribute */
                pattrib = &pmgntframe->attrib;
 
                dump_mgntframe(padapter, pmgntframe);
 
-       }
-       else
-       {
+       } else {
                DBG_8192C("frame_control = 0x%x\n", frame_control & (IEEE80211_FCTL_FTYPE|IEEE80211_FCTL_STYPE));
        }
 
        rtw_ies_remove_ie(pbuf, &len, _BEACON_IE_OFFSET_, _VENDOR_SPECIFIC_IE_, P2P_OUI, 4);
        rtw_ies_remove_ie(pbuf, &len, _BEACON_IE_OFFSET_, _VENDOR_SPECIFIC_IE_, WFD_OUI, 4);
 
-       if (rtw_check_beacon_data(adapter, pbuf,  len) == _SUCCESS)
-       {
+       if (rtw_check_beacon_data(adapter, pbuf,  len) == _SUCCESS) {
                ret = 0;
-       }
-       else
-       {
+       } else {
                ret = -EINVAL;
        }
 
 
        DBG_871X("+"FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
 
-       if (check_fwstate(pmlmepriv, (_FW_LINKED|WIFI_AP_STATE)) != true)
-       {
+       if (check_fwstate(pmlmepriv, (_FW_LINKED|WIFI_AP_STATE)) != true) {
                DBG_8192C("%s, fw_state != FW_LINKED|WIFI_AP_STATE\n", __func__);
                return -EINVAL;
        }
 
 
-       if (!mac)
-       {
+       if (!mac) {
                DBG_8192C("flush all sta, and cam_entry\n");
 
                flush_all_cam_entry(padapter);  /* clear CAM */
 
        if (mac[0] == 0xff && mac[1] == 0xff &&
            mac[2] == 0xff && mac[3] == 0xff &&
-           mac[4] == 0xff && mac[5] == 0xff)
-       {
+           mac[4] == 0xff && mac[5] == 0xff) {
                return -EINVAL;
        }
 
        plist = get_next(phead);
 
        /* check asoc_queue */
-       while (phead != plist)
-       {
+       while (phead != plist) {
                psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list);
 
                plist = get_next(plist);
 
-               if (!memcmp((u8 *)mac, psta->hwaddr, ETH_ALEN))
-               {
-                       if (psta->dot8021xalg == 1 && psta->bpairwise_key_installed == false)
-                       {
+               if (!memcmp((u8 *)mac, psta->hwaddr, ETH_ALEN)) {
+                       if (psta->dot8021xalg == 1 && psta->bpairwise_key_installed == false) {
                                DBG_8192C("%s, sta's dot8021xalg = 1 and key_installed = false\n", __func__);
-                       }
-                       else
-                       {
+                       } else {
                                DBG_8192C("free psta =%p, aid =%d\n", psta, psta->aid);
 
                                list_del_init(&psta->asoc_list);
        plist = get_next(phead);
 
        /* check asoc_queue */
-       while (phead != plist)
-       {
+       while (phead != plist) {
                if (idx == i) psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list);
                plist = get_next(plist);
                i++;
        spin_lock_bh(&pstapriv->asoc_list_lock);
        psta = rtw_sta_info_get_by_idx(idx, pstapriv);
        spin_unlock_bh(&pstapriv->asoc_list_lock);
-       if (NULL == psta)
-       {
+       if (NULL == psta) {
                DBG_871X("Station is not found\n");
                ret = -ENOENT;
                goto exit;
        }
 
        /* starting alloc mgmt frame to dump it */
-       if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL)
-       {
+       if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) {
                /* ret = -ENOMEM; */
                ret = _FAIL;
                goto exit;
 
        pattrib->last_txcmdsz = pattrib->pktlen;
 
-       if (dump_mgntframe_and_wait_ack(padapter, pmgntframe) != _SUCCESS)
-       {
+       if (dump_mgntframe_and_wait_ack(padapter, pmgntframe) != _SUCCESS) {
                ack = false;
                ret = _FAIL;
 
                #ifdef DEBUG_CFG80211
                DBG_8192C("%s, ack == _FAIL\n", __func__);
                #endif
-       }
-       else
-       {
-
+       } else {
                msleep(50);
 
                #ifdef DEBUG_CFG80211
                rtw_clear_scan_deny(padapter);
                break;
        case P2P_INVIT_RESP:
-               if (pwdev_priv->invit_info.flags & BIT(0)
-                       && pwdev_priv->invit_info.status == 0)
-               {
+               if (pwdev_priv->invit_info.flags & BIT(0) && pwdev_priv->invit_info.status == 0) {
                        DBG_871X(FUNC_ADPT_FMT" agree with invitation of persistent group\n",
                                FUNC_ADPT_ARG(padapter));
                        rtw_set_scan_deny(padapter, 5000);
 }
 
 #if defined(CONFIG_PNO_SUPPORT)
-static int cfg80211_rtw_sched_scan_start(struct wiphy *wiphy,
-               struct net_device *dev,
-               struct cfg80211_sched_scan_request *request) {
-
+static int cfg80211_rtw_sched_scan_start(struct wiphy *wiphy, struct net_device *dev,
+                                        struct cfg80211_sched_scan_request *request)
+{
        struct adapter *padapter = rtw_netdev_priv(dev);
        struct  mlme_priv *pmlmepriv = &(padapter->mlmepriv);
        int ret;
        return ret;
 }
 
-static int cfg80211_rtw_sched_scan_stop(struct wiphy *wiphy,
-               struct net_device *dev) {
+static int cfg80211_rtw_sched_scan_stop(struct wiphy *wiphy, struct net_device *dev)
+{
        return rtw_android_pno_enable(dev, false);
 }
 #endif /* CONFIG_PNO_SUPPORT */
         *if BW_40 rx_mask[4]= 0x01;
         *highest supported RX rate
         */
-       if (rf_type == RF_1T1R)
-       {
+       if (rf_type == RF_1T1R) {
                ht_cap->mcs.rx_mask[0] = 0xFF;
                ht_cap->mcs.rx_mask[1] = 0x00;
                ht_cap->mcs.rx_mask[4] = 0x01;
 
                ht_cap->mcs.rx_highest = cpu_to_le16(MAX_BIT_RATE_40MHZ_MCS7);
-       }
-       else if ((rf_type == RF_1T2R) || (rf_type == RF_2T2R))
-       {
+       } else if ((rf_type == RF_1T2R) || (rf_type == RF_2T2R)) {
                ht_cap->mcs.rx_mask[0] = 0xFF;
                ht_cap->mcs.rx_mask[1] = 0xFF;
                ht_cap->mcs.rx_mask[4] = 0x01;
 
                ht_cap->mcs.rx_highest = cpu_to_le16(MAX_BIT_RATE_40MHZ_MCS15);
-       }
-       else
-       {
+       } else {
                DBG_8192C("%s, error rf_type =%d\n", __func__, rf_type);
        }