Merge tag 'iommu-updates-v4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/joro...
[firefly-linux-kernel-4.4.55.git] / drivers / staging / rtl8712 / rtl871x_cmd.c
index ef7182961002e8c45394a6a208cfe9bf850023e3..562a102031277aa25672d33a2637835a54c81ed5 100644 (file)
@@ -70,7 +70,7 @@ static sint _init_cmd_priv(struct cmd_priv *pcmdpriv)
                return _FAIL;
        pcmdpriv->cmd_buf = pcmdpriv->cmd_allocated_buf  +  CMDBUFF_ALIGN_SZ -
                            ((addr_t)(pcmdpriv->cmd_allocated_buf) &
-                           (CMDBUFF_ALIGN_SZ-1));
+                           (CMDBUFF_ALIGN_SZ - 1));
        pcmdpriv->rsp_allocated_buf = kmalloc(MAX_RSPSZ + 4, GFP_ATOMIC);
        if (pcmdpriv->rsp_allocated_buf == NULL)
                return _FAIL;
@@ -137,9 +137,9 @@ static struct cmd_obj *_dequeue_cmd(struct  __queue *queue)
        struct cmd_obj *obj;
 
        spin_lock_irqsave(&(queue->lock), irqL);
-       if (list_empty(&(queue->queue)))
+       if (list_empty(&(queue->queue))) {
                obj = NULL;
-       else {
+       else {
                obj = LIST_CONTAINOR(queue->queue.next,
                                     struct cmd_obj, list);
                list_del_init(&obj->list);
@@ -172,7 +172,7 @@ u32 r8712_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *obj)
 {
        int res;
 
-       if (pcmdpriv->padapter->eeprompriv.bautoload_fail_flag == true)
+       if (pcmdpriv->padapter->eeprompriv.bautoload_fail_flag)
                return _FAIL;
        res = _enqueue_cmd(&pcmdpriv->cmd_queue, obj);
        up(&pcmdpriv->cmd_queue_sema);
@@ -186,7 +186,7 @@ u32 r8712_enqueue_cmd_ex(struct cmd_priv *pcmdpriv, struct cmd_obj *obj)
 
        if (obj == NULL)
                return _SUCCESS;
-       if (pcmdpriv->padapter->eeprompriv.bautoload_fail_flag == true)
+       if (pcmdpriv->padapter->eeprompriv.bautoload_fail_flag)
                return _FAIL;
        queue = &pcmdpriv->cmd_queue;
        spin_lock_irqsave(&queue->lock, irqL);
@@ -485,7 +485,7 @@ u8 r8712_joinbss_cmd(struct _adapter  *padapter, struct wlan_network *pnetwork)
                return _FAIL;
 
        /* for hidden ap to set fw_state here */
-       if (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) !=
+       if (check_fwstate(pmlmepriv, WIFI_STATION_STATE | WIFI_ADHOC_STATE) !=
            true) {
                switch (ndis_network_mode) {
                case Ndis802_11IBSS:
@@ -508,18 +508,18 @@ u8 r8712_joinbss_cmd(struct _adapter  *padapter, struct wlan_network *pnetwork)
        memcpy(psecnetwork, &pnetwork->network, sizeof(*psecnetwork));
        psecuritypriv->authenticator_ie[0] = (unsigned char)
                                             psecnetwork->IELength;
-       if ((psecnetwork->IELength-12) < (256 - 1))
+       if ((psecnetwork->IELength - 12) < (256 - 1))
                memcpy(&psecuritypriv->authenticator_ie[1],
-                       &psecnetwork->IEs[12], psecnetwork->IELength-12);
+                       &psecnetwork->IEs[12], psecnetwork->IELength - 12);
        else
                memcpy(&psecuritypriv->authenticator_ie[1],
-                       &psecnetwork->IEs[12], (256-1));
+                       &psecnetwork->IEs[12], (256 - 1));
        psecnetwork->IELength = 0;
        /* If the driver wants to use the bssid to create the connection.
         * If not,  we copy the connecting AP's MAC address to it so that
         * the driver just has the bssid information for PMKIDList searching.
         */
-       if (pmlmepriv->assoc_by_bssid == false)
+       if (!pmlmepriv->assoc_by_bssid)
                ether_addr_copy(&pmlmepriv->assoc_bssid[0],
                                &pnetwork->network.MacAddress[0]);
        psecnetwork->IELength = r8712_restruct_sec_ie(padapter,
@@ -538,8 +538,9 @@ u8 r8712_joinbss_cmd(struct _adapter  *padapter, struct wlan_network *pnetwork)
                if (psecnetwork->IELength != tmp_len) {
                        psecnetwork->IELength = tmp_len;
                        pqospriv->qos_option = 1; /* WMM IE in beacon */
-               } else
+               } else {
                        pqospriv->qos_option = 0; /* no WMM IE in beacon */
+               }
        }
        if (pregistrypriv->ht_enable) {
                /* For WEP mode, we will use the bg mode to do the connection
@@ -679,7 +680,7 @@ u8 r8712_setstakey_cmd(struct _adapter *padapter, u8 *psta, u8 unicast_key)
        else
                GET_ENCRY_ALGO(psecuritypriv, sta,
                               psetstakey_para->algorithm, false);
-       if (unicast_key == true)
+       if (unicast_key)
                memcpy(&psetstakey_para->key, &sta->x_UncstKey, 16);
        else
                memcpy(&psetstakey_para->key,