]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
staging: wilc1000: remove inner block {} and resetting of mode variable
authorAjay Singh <ajay.kathat@microchip.com>
Mon, 23 Apr 2018 16:33:17 +0000 (22:03 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Apr 2018 13:54:14 +0000 (15:54 +0200)
Cleanup fixes to remove the uncessary inner block { /* */ } and setting
of 'mode' variable.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c

index a80d4d71569ad2e8d51ae67a3caa4551514794a8..4eb697fa318abaabf2bb3669c8a377dec634db46 100644 (file)
@@ -1008,31 +1008,28 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
                        break;
                }
 
-               {
-                       mode = 0;
-                       if (!pairwise) {
-                               if (params->key_len > 16 && params->cipher == WLAN_CIPHER_SUITE_TKIP) {
-                                       rx_mic = params->key + 24;
-                                       tx_mic = params->key + 16;
-                                       keylen = params->key_len - 16;
-                               }
-
-                               wilc_add_rx_gtk(vif, params->key, keylen,
-                                               key_index, params->seq_len,
-                                               params->seq, rx_mic,
-                                               tx_mic, STATION_MODE,
-                                               mode);
-                       } else {
-                               if (params->key_len > 16 && params->cipher == WLAN_CIPHER_SUITE_TKIP) {
-                                       rx_mic = params->key + 24;
-                                       tx_mic = params->key + 16;
-                                       keylen = params->key_len - 16;
-                               }
+               if (!pairwise) {
+                       if (params->key_len > 16 && params->cipher == WLAN_CIPHER_SUITE_TKIP) {
+                               rx_mic = params->key + 24;
+                               tx_mic = params->key + 16;
+                               keylen = params->key_len - 16;
+                       }
 
-                               wilc_add_ptk(vif, params->key, keylen,
-                                            mac_addr, rx_mic, tx_mic,
-                                            STATION_MODE, mode, key_index);
+                       wilc_add_rx_gtk(vif, params->key, keylen,
+                                       key_index, params->seq_len,
+                                       params->seq, rx_mic,
+                                       tx_mic, STATION_MODE,
+                                       mode);
+               } else {
+                       if (params->key_len > 16 && params->cipher == WLAN_CIPHER_SUITE_TKIP) {
+                               rx_mic = params->key + 24;
+                               tx_mic = params->key + 16;
+                               keylen = params->key_len - 16;
                        }
+
+                       wilc_add_ptk(vif, params->key, keylen,
+                                    mac_addr, rx_mic, tx_mic,
+                                    STATION_MODE, mode, key_index);
                }
                break;