Return-path: Received: from esa2.microchip.iphmx.com ([68.232.149.84]:12719 "EHLO esa2.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755749AbeDWQfX (ORCPT ); Mon, 23 Apr 2018 12:35:23 -0400 From: Ajay Singh To: CC: , , , , , , , Ajay Singh Subject: [RESEND 15/33] staging: wilc1000: remove inner block {} and resetting of mode variable Date: Mon, 23 Apr 2018 22:03:17 +0530 Message-ID: <1524501215-4963-16-git-send-email-ajay.kathat@microchip.com> (sfid-20180423_183531_535967_C7DC9D01) In-Reply-To: <1524501215-4963-1-git-send-email-ajay.kathat@microchip.com> References: <1524501215-4963-1-git-send-email-ajay.kathat@microchip.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-wireless-owner@vger.kernel.org List-ID: Cleanup fixes to remove the uncessary inner block { /* */ } and setting of 'mode' variable. Signed-off-by: Ajay Singh Reviewed-by: Claudiu Beznea --- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 43 +++++++++++------------ 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index a80d4d7..4eb697f 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -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; -- 2.7.4