From patchwork Mon May 7 08:43:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 10383563 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D55A56037F for ; Mon, 7 May 2018 08:45:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CABF0286DF for ; Mon, 7 May 2018 08:45:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF95028A96; Mon, 7 May 2018 08:45:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60761286DF for ; Mon, 7 May 2018 08:45:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752446AbeEGIpa (ORCPT ); Mon, 7 May 2018 04:45:30 -0400 Received: from esa4.microchip.iphmx.com ([68.232.154.123]:7399 "EHLO esa4.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752115AbeEGIoz (ORCPT ); Mon, 7 May 2018 04:44:55 -0400 X-IronPort-AV: E=Sophos;i="5.49,373,1520924400"; d="scan'208";a="13627253" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 07 May 2018 01:44:55 -0700 Received: from ajaysk-VirtualBox.microchip.com (10.10.76.4) by chn-sv-exch05.mchp-main.com (10.10.76.106) with Microsoft SMTP Server id 14.3.352.0; Mon, 7 May 2018 01:44:54 -0700 From: Ajay Singh To: CC: , , , , , , , Ajay Singh Subject: [PATCH 22/30] staging: wilc1000: fix line over 80 chars issue in connect() Date: Mon, 7 May 2018 14:13:26 +0530 Message-ID: <1525682614-3824-23-git-send-email-ajay.kathat@microchip.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525682614-3824-1-git-send-email-ajay.kathat@microchip.com> References: <1525682614-3824-1-git-send-email-ajay.kathat@microchip.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix line over 80 characters in connect() by using temporary variables. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 29 +++++++++++++---------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index ec4fa1c..00381c9 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -676,7 +676,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, u32 sel_bssi_idx = UINT_MAX; u8 u8security = NO_ENCRYPT; enum AUTHTYPE auth_type = ANY; - + u32 cipher_group; struct wilc_priv *priv; struct host_if_drv *wfi_drv; struct network_info *nw_info = NULL; @@ -724,32 +724,35 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, memset(priv->wep_key, 0, sizeof(priv->wep_key)); memset(priv->wep_key_len, 0, sizeof(priv->wep_key_len)); - if (sme->crypto.cipher_group != NO_ENCRYPT) { - if (sme->crypto.cipher_group == WLAN_CIPHER_SUITE_WEP40) { + cipher_group = sme->crypto.cipher_group; + if (cipher_group != NO_ENCRYPT) { + if (cipher_group == WLAN_CIPHER_SUITE_WEP40) { u8security = ENCRYPT_ENABLED | WEP; priv->wep_key_len[sme->key_idx] = sme->key_len; - memcpy(priv->wep_key[sme->key_idx], sme->key, sme->key_len); + memcpy(priv->wep_key[sme->key_idx], sme->key, + sme->key_len); wilc_set_wep_default_keyid(vif, sme->key_idx); wilc_add_wep_key_bss_sta(vif, sme->key, sme->key_len, sme->key_idx); - } else if (sme->crypto.cipher_group == WLAN_CIPHER_SUITE_WEP104) { + } else if (cipher_group == WLAN_CIPHER_SUITE_WEP104) { u8security = ENCRYPT_ENABLED | WEP | WEP_EXTENDED; priv->wep_key_len[sme->key_idx] = sme->key_len; - memcpy(priv->wep_key[sme->key_idx], sme->key, sme->key_len); + memcpy(priv->wep_key[sme->key_idx], sme->key, + sme->key_len); wilc_set_wep_default_keyid(vif, sme->key_idx); wilc_add_wep_key_bss_sta(vif, sme->key, sme->key_len, sme->key_idx); - } else if (sme->crypto.wpa_versions & NL80211_WPA_VERSION_2) { - if (sme->crypto.cipher_group == WLAN_CIPHER_SUITE_TKIP) + } else if (sme->crypto.wpa_versions & NL80211_WPA_VERSION_2) { + if (cipher_group == WLAN_CIPHER_SUITE_TKIP) u8security = ENCRYPT_ENABLED | WPA2 | TKIP; else u8security = ENCRYPT_ENABLED | WPA2 | AES; - } else if (sme->crypto.wpa_versions & NL80211_WPA_VERSION_1) { - if (sme->crypto.cipher_group == WLAN_CIPHER_SUITE_TKIP) + } else if (sme->crypto.wpa_versions & NL80211_WPA_VERSION_1) { + if (cipher_group == WLAN_CIPHER_SUITE_TKIP) u8security = ENCRYPT_ENABLED | WPA | TKIP; else u8security = ENCRYPT_ENABLED | WPA | AES; @@ -764,14 +767,16 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, if ((sme->crypto.wpa_versions & NL80211_WPA_VERSION_1) || (sme->crypto.wpa_versions & NL80211_WPA_VERSION_2)) { for (i = 0; i < sme->crypto.n_ciphers_pairwise; i++) { - if (sme->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_TKIP) + u32 ciphers_pairwise = sme->crypto.ciphers_pairwise[i]; + + if (ciphers_pairwise == WLAN_CIPHER_SUITE_TKIP) u8security = u8security | TKIP; else u8security = u8security | AES; } } - switch (sme->auth_type) { + switch (sme->auth_type) { case NL80211_AUTHTYPE_OPEN_SYSTEM: auth_type = OPEN_SYSTEM; break;