From nobody Thu May 7 13:12:05 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59368C433F5 for ; Sat, 28 May 2022 12:31:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355919AbiE1Mby (ORCPT ); Sat, 28 May 2022 08:31:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355881AbiE1Mbq (ORCPT ); Sat, 28 May 2022 08:31:46 -0400 Received: from shout01.mail.de (shout01.mail.de [IPv6:2001:868:100:600::216]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F12713CE0 for ; Sat, 28 May 2022 05:31:44 -0700 (PDT) Received: from postfix02.mail.de (postfix02.bt.mail.de [10.0.121.126]) by shout01.mail.de (Postfix) with ESMTP id 53E55A1E26; Sat, 28 May 2022 14:31:41 +0200 (CEST) Received: from smtp03.mail.de (smtp03.bt.mail.de [10.0.121.213]) by postfix02.mail.de (Postfix) with ESMTP id 2DBCDA03C1; Sat, 28 May 2022 14:31:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mail.de; s=mailde202009; t=1653741101; bh=VW2lXXFVZikp6og/KjbDOW9VtLe5mLP0//Lj7wLgxto=; h=From:To:Cc:Subject:Date:Message-Id:From:To:CC:Subject:Reply-To; b=gxuPP6+k/LvAf1gIEmz0kxHLDZT8xfECbBSSb9hFfEMq05t51a2IKoxdJRpoPo1/4 1MpxmX5JpohxP/1cdY9V5NTxPAe9B76eHQc3ZMA7its8/r+iy32j8G14IDpAF2AUdi x9ItWocpAQPsU2CsLOD8lmePpNZUo2uqVpGnkQ4Gw2SgOkaCdHTfGZg/HuUTM3E6A9 /yWlozlU4HkvQvDrl5GmPR4ao7eQ9z2w2CQW7OsXpJKdhTUMPq4zOYP0yV6asZSi4l h7aY6+nKYb/2nJPBBxMXvNgJeUcvrRTRpsmo+xyoPituEwxs+h2XcAPXruVWT4VhA2 GbbzjwzNyx8jQ== Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtp03.mail.de (Postfix) with ESMTPSA id 9EF55A403D; Sat, 28 May 2022 14:31:39 +0200 (CEST) From: Hannes Braun To: gregkh@linuxfoundation.org, hdegoede@redhat.com, Larry.Finger@lwfinger.net, joe@perches.com Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, fabioaiuto83@gmail.com, dan.carpenter@oracle.com, Hannes Braun Subject: [PATCH v2] staging: rtl8723bs: fix placement of braces Date: Sat, 28 May 2022 14:31:15 +0200 Message-Id: <20220528123115.13024-1-hannesbraun@mail.de> In-Reply-To: <1cac230f14153984edd5f0d165e8a84b639a6796.camel@perches.com> References: <1cac230f14153984edd5f0d165e8a84b639a6796.camel@perches.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-purgate-size: 22719 X-purgate-ID: 154282::1653741101-0000061A-F04CF378/0/0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This patch should eliminate the following errors/warnings emitted by checkpatch.pl: - that open brace { should be on the previous line - else should follow close brace '}' - braces {} are not necessary for single statement blocks Signed-off-by: Hannes Braun --- This fixes the cases (mentioned by Joe Perches) where the closing parenthesis and the opening brace should be on the lines above. As proposed, the indentation and the placement of the operators can then be fixed in a seperate patch. .../staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 223 +++++------------- 1 file changed, 65 insertions(+), 158 deletions(-) diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/st= aging/rtl8723bs/os_dep/ioctl_cfg80211.c index 43b5604c0bca..7240220cf6ae 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c @@ -366,9 +366,8 @@ void rtw_cfg80211_ibss_indicate_connect(struct adapter = *padapter) int freq =3D (int)cur_network->network.configuration.ds_config; struct ieee80211_channel *chan; =20 - if (pwdev->iftype !=3D NL80211_IFTYPE_ADHOC) { + if (pwdev->iftype !=3D NL80211_IFTYPE_ADHOC) return; - } =20 if (!rtw_cfg80211_check_bss(padapter)) { struct wlan_bssid_ex *pnetwork =3D &(padapter->mlmeextpriv.mlmext_info.= network); @@ -544,9 +543,8 @@ static int rtw_cfg80211_ap_set_encryption(struct net_de= vice *dev, struct ieee_pa goto exit; } =20 - if (wep_key_len > 0) { + if (wep_key_len > 0) wep_key_len =3D wep_key_len <=3D 5 ? 5 : 13; - } =20 if (psecuritypriv->bWepDefaultKeyIdxSet =3D=3D 0) { /* wep default key has not been set, so use this key index as default k= ey. */ @@ -582,9 +580,8 @@ static int rtw_cfg80211_ap_set_encryption(struct net_de= vice *dev, struct ieee_pa memcpy(grpkey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 := param->u.crypt.key_len)); =20 psecuritypriv->dot118021XGrpPrivacy =3D _WEP40_; - if (param->u.crypt.key_len =3D=3D 13) { + if (param->u.crypt.key_len =3D=3D 13) psecuritypriv->dot118021XGrpPrivacy =3D _WEP104_; - } =20 } else if (strcmp(param->u.crypt.alg, "TKIP") =3D=3D 0) { psecuritypriv->dot118021XGrpPrivacy =3D _TKIP_; @@ -626,24 +623,16 @@ static int rtw_cfg80211_ap_set_encryption(struct net_= device *dev, struct ieee_pa =20 } =20 - if (psecuritypriv->dot11AuthAlgrthm =3D=3D dot11AuthAlgrthm_8021X && psta= ) /* psk/802_1x */ - { - if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) - { - if (param->u.crypt.set_tx =3D=3D 1) /* pairwise key */ - { + if (psecuritypriv->dot11AuthAlgrthm =3D=3D dot11AuthAlgrthm_8021X && psta= ) { /* psk/802_1x */ + if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { + if (param->u.crypt.set_tx =3D=3D 1) { /* pairwise key */ memcpy(psta->dot118021x_UncstKey.skey, param->u.crypt.key, (param->u.c= rypt.key_len > 16 ? 16 : param->u.crypt.key_len)); =20 - if (strcmp(param->u.crypt.alg, "WEP") =3D=3D 0) - { + if (strcmp(param->u.crypt.alg, "WEP") =3D=3D 0) { psta->dot118021XPrivacy =3D _WEP40_; if (param->u.crypt.key_len =3D=3D 13) - { psta->dot118021XPrivacy =3D _WEP104_; - } - } - else if (strcmp(param->u.crypt.alg, "TKIP") =3D=3D 0) - { + } else if (strcmp(param->u.crypt.alg, "TKIP") =3D=3D 0) { psta->dot118021XPrivacy =3D _TKIP_; =20 /* DEBUG_ERR("set key length :param->u.crypt.key_len =3D%d\n", param-= >u.crypt.key_len); */ @@ -653,14 +642,10 @@ static int rtw_cfg80211_ap_set_encryption(struct net_= device *dev, struct ieee_pa =20 psecuritypriv->busetkipkey =3D true; =20 - } - else if (strcmp(param->u.crypt.alg, "CCMP") =3D=3D 0) - { + } else if (strcmp(param->u.crypt.alg, "CCMP") =3D=3D 0) { =20 psta->dot118021XPrivacy =3D _AES_; - } - else - { + } else { psta->dot118021XPrivacy =3D _NO_PRIVACY_; } =20 @@ -670,21 +655,14 @@ static int rtw_cfg80211_ap_set_encryption(struct net_= device *dev, struct ieee_pa =20 psta->bpairwise_key_installed =3D true; =20 - } - else/* group key??? */ - { - if (strcmp(param->u.crypt.alg, "WEP") =3D=3D 0) - { + } else { /* group key??? */ + if (strcmp(param->u.crypt.alg, "WEP") =3D=3D 0) { memcpy(grpkey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 = : param->u.crypt.key_len)); =20 psecuritypriv->dot118021XGrpPrivacy =3D _WEP40_; if (param->u.crypt.key_len =3D=3D 13) - { psecuritypriv->dot118021XGrpPrivacy =3D _WEP104_; - } - } - else if (strcmp(param->u.crypt.alg, "TKIP") =3D=3D 0) - { + } else if (strcmp(param->u.crypt.alg, "TKIP") =3D=3D 0) { psecuritypriv->dot118021XGrpPrivacy =3D _TKIP_; =20 memcpy(grpkey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 = : param->u.crypt.key_len)); @@ -696,15 +674,11 @@ static int rtw_cfg80211_ap_set_encryption(struct net_= device *dev, struct ieee_pa =20 psecuritypriv->busetkipkey =3D true; =20 - } - else if (strcmp(param->u.crypt.alg, "CCMP") =3D=3D 0) - { + } else if (strcmp(param->u.crypt.alg, "CCMP") =3D=3D 0) { psecuritypriv->dot118021XGrpPrivacy =3D _AES_; =20 memcpy(grpkey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 = : param->u.crypt.key_len)); - } - else - { + } else { psecuritypriv->dot118021XGrpPrivacy =3D _NO_PRIVACY_; } =20 @@ -717,8 +691,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_de= vice *dev, struct ieee_pa rtw_ap_set_group_key(padapter, param->u.crypt.key, psecuritypriv->dot1= 18021XGrpPrivacy, param->u.crypt.idx); =20 pbcmc_sta =3D rtw_get_bcmc_stainfo(padapter); - if (pbcmc_sta) - { + if (pbcmc_sta) { pbcmc_sta->ieee8021x_blocked =3D false; pbcmc_sta->dot118021XPrivacy =3D psecuritypriv->dot118021XGrpPrivacy;= /* rx will use bmc_sta's dot118021XPrivacy */ } @@ -746,20 +719,16 @@ static int rtw_cfg80211_set_encryption(struct net_dev= ice *dev, struct ieee_param param->u.crypt.err =3D 0; param->u.crypt.alg[IEEE_CRYPT_ALG_NAME_LEN - 1] =3D '\0'; =20 - if (param_len < (u32) ((u8 *) param->u.crypt.key - (u8 *) param) + param-= >u.crypt.key_len) - { + if (param_len < (u32) ((u8 *) param->u.crypt.key - (u8 *) param) + param-= >u.crypt.key_len) { ret =3D -EINVAL; goto exit; } =20 if (param->sta_addr[0] =3D=3D 0xff && param->sta_addr[1] =3D=3D 0xff && param->sta_addr[2] =3D=3D 0xff && param->sta_addr[3] =3D=3D 0xff && - param->sta_addr[4] =3D=3D 0xff && param->sta_addr[5] =3D=3D 0xff) - { + param->sta_addr[4] =3D=3D 0xff && param->sta_addr[5] =3D=3D 0xff) { if (param->u.crypt.idx >=3D WEP_KEYS - || param->u.crypt.idx >=3D BIP_MAX_KEYID - ) - { + || param->u.crypt.idx >=3D BIP_MAX_KEYID) { ret =3D -EINVAL; goto exit; } @@ -770,19 +739,16 @@ static int rtw_cfg80211_set_encryption(struct net_dev= ice *dev, struct ieee_param } } =20 - if (strcmp(param->u.crypt.alg, "WEP") =3D=3D 0) - { + if (strcmp(param->u.crypt.alg, "WEP") =3D=3D 0) { wep_key_idx =3D param->u.crypt.idx; wep_key_len =3D param->u.crypt.key_len; =20 - if ((wep_key_idx >=3D WEP_KEYS) || (wep_key_len <=3D 0)) - { + if ((wep_key_idx >=3D WEP_KEYS) || (wep_key_len <=3D 0)) { ret =3D -EINVAL; goto exit; } =20 - if (psecuritypriv->bWepDefaultKeyIdxSet =3D=3D 0) - { + if (psecuritypriv->bWepDefaultKeyIdxSet =3D=3D 0) { /* wep default key has not been set, so use this key index as default k= ey. */ =20 wep_key_len =3D wep_key_len <=3D 5 ? 5 : 13; @@ -791,8 +757,7 @@ static int rtw_cfg80211_set_encryption(struct net_devic= e *dev, struct ieee_param psecuritypriv->dot11PrivacyAlgrthm =3D _WEP40_; psecuritypriv->dot118021XGrpPrivacy =3D _WEP40_; =20 - if (wep_key_len =3D=3D 13) - { + if (wep_key_len =3D=3D 13) { psecuritypriv->dot11PrivacyAlgrthm =3D _WEP104_; psecuritypriv->dot118021XGrpPrivacy =3D _WEP104_; } @@ -809,13 +774,11 @@ static int rtw_cfg80211_set_encryption(struct net_dev= ice *dev, struct ieee_param goto exit; } =20 - if (padapter->securitypriv.dot11AuthAlgrthm =3D=3D dot11AuthAlgrthm_8021X= ) /* 802_1x */ - { + if (padapter->securitypriv.dot11AuthAlgrthm =3D=3D dot11AuthAlgrthm_8021X= ) { /* 802_1x */ struct sta_info *psta, *pbcmc_sta; struct sta_priv *pstapriv =3D &padapter->stapriv; =20 - if (check_fwstate(pmlmepriv, WIFI_STATION_STATE | WIFI_MP_STATE) =3D=3D = true) /* sta mode */ - { + if (check_fwstate(pmlmepriv, WIFI_STATION_STATE | WIFI_MP_STATE) =3D=3D = true) { /* sta mode */ psta =3D rtw_get_stainfo(pstapriv, get_bssid(pmlmepriv)); if (psta) { /* Jeff: don't disable ieee8021x_blocked while clearing key */ @@ -824,18 +787,15 @@ static int rtw_cfg80211_set_encryption(struct net_dev= ice *dev, struct ieee_param =20 =20 if ((padapter->securitypriv.ndisencryptstatus =3D=3D Ndis802_11Encrypt= ion2Enabled) || - (padapter->securitypriv.ndisencryptstatus =3D=3D Ndis802_11Encrypti= on3Enabled)) - { + (padapter->securitypriv.ndisencryptstatus =3D=3D Ndis802_11Encrypti= on3Enabled)) { psta->dot118021XPrivacy =3D padapter->securitypriv.dot11PrivacyAlgrth= m; } =20 - if (param->u.crypt.set_tx =3D=3D 1)/* pairwise key */ - { + if (param->u.crypt.set_tx =3D=3D 1) { /* pairwise key */ =20 memcpy(psta->dot118021x_UncstKey.skey, param->u.crypt.key, (param->u.= crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); =20 - if (strcmp(param->u.crypt.alg, "TKIP") =3D=3D 0)/* set mic key */ - { + if (strcmp(param->u.crypt.alg, "TKIP") =3D=3D 0) { /* set mic key */ /* DEBUG_ERR(("\nset key length :param->u.crypt.key_len =3D%d\n", pa= ram->u.crypt.key_len)); */ memcpy(psta->dot11tkiptxmickey.skey, &(param->u.crypt.key[16]), 8); memcpy(psta->dot11tkiprxmickey.skey, &(param->u.crypt.key[24]), 8); @@ -845,11 +805,8 @@ static int rtw_cfg80211_set_encryption(struct net_devi= ce *dev, struct ieee_param } =20 rtw_setstakey_cmd(padapter, psta, true, true); - } - else/* group key */ - { - if (strcmp(param->u.crypt.alg, "TKIP") =3D=3D 0 || strcmp(param->u.cr= ypt.alg, "CCMP") =3D=3D 0) - { + } else { /* group key */ + if (strcmp(param->u.crypt.alg, "TKIP") =3D=3D 0 || strcmp(param->u.cr= ypt.alg, "CCMP") =3D=3D 0) { memcpy(padapter->securitypriv.dot118021XGrpKey[param->u.crypt.idx].s= key, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt= .key_len)); memcpy(padapter->securitypriv.dot118021XGrptxmickey[param->u.crypt.i= dx].skey, &(param->u.crypt.key[16]), 8); memcpy(padapter->securitypriv.dot118021XGrprxmickey[param->u.crypt.i= dx].skey, &(param->u.crypt.key[24]), 8); @@ -857,9 +814,7 @@ static int rtw_cfg80211_set_encryption(struct net_devic= e *dev, struct ieee_param =20 padapter->securitypriv.dot118021XGrpKeyid =3D param->u.crypt.idx; rtw_set_key(padapter, &padapter->securitypriv, param->u.crypt.idx, 1= , true); - } - else if (strcmp(param->u.crypt.alg, "BIP") =3D=3D 0) - { + } else if (strcmp(param->u.crypt.alg, "BIP") =3D=3D 0) { /* save the IGTK key, length 16 bytes */ memcpy(padapter->securitypriv.dot11wBIPKey[param->u.crypt.idx].skey,= param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key= _len)); /* @@ -873,25 +828,19 @@ static int rtw_cfg80211_set_encryption(struct net_dev= ice *dev, struct ieee_param } =20 pbcmc_sta =3D rtw_get_bcmc_stainfo(padapter); - if (!pbcmc_sta) - { + if (!pbcmc_sta) { /* DEBUG_ERR(("Set OID_802_11_ADD_KEY: bcmc stainfo is null\n")); */ - } - else - { + } else { /* Jeff: don't disable ieee8021x_blocked while clearing key */ if (strcmp(param->u.crypt.alg, "none") !=3D 0) pbcmc_sta->ieee8021x_blocked =3D false; =20 if ((padapter->securitypriv.ndisencryptstatus =3D=3D Ndis802_11Encrypt= ion2Enabled) || - (padapter->securitypriv.ndisencryptstatus =3D=3D Ndis802_11Encrypti= on3Enabled)) - { + (padapter->securitypriv.ndisencryptstatus =3D=3D Ndis802_11Encrypti= on3Enabled)) { pbcmc_sta->dot118021XPrivacy =3D padapter->securitypriv.dot11PrivacyA= lgrthm; } } - } - else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) /* adhoc mode */ - { + } else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) { /* adhoc mode */ } } =20 @@ -949,39 +898,29 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, = struct net_device *ndev, =20 =20 if (!mac_addr || is_broadcast_ether_addr(mac_addr)) - { param->u.crypt.set_tx =3D 0; /* for wpa/wpa2 group key */ - } else { + else param->u.crypt.set_tx =3D 1; /* for wpa/wpa2 pairwise key */ - } =20 param->u.crypt.idx =3D key_index; =20 if (params->seq_len && params->seq) - { memcpy(param->u.crypt.seq, (u8 *)params->seq, params->seq_len); - } =20 - if (params->key_len && params->key) - { + if (params->key_len && params->key) { param->u.crypt.key_len =3D params->key_len; memcpy(param->u.crypt.key, (u8 *)params->key, params->key_len); } =20 - if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) =3D=3D true) - { + if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) =3D=3D true) { ret =3D rtw_cfg80211_set_encryption(ndev, param, param_len); - } - else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) =3D=3D true) - { + } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) =3D=3D true) { if (mac_addr) memcpy(param->sta_addr, (void *)mac_addr, ETH_ALEN); =20 ret =3D rtw_cfg80211_ap_set_encryption(ndev, param, param_len); - } - else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) =3D=3D true - || check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) =3D= =3D true) - { + } else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) =3D=3D true + || check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) =3D= =3D true) { ret =3D rtw_cfg80211_set_encryption(ndev, param, param_le= n); } =20 @@ -1007,8 +946,7 @@ static int cfg80211_rtw_del_key(struct wiphy *wiphy, s= truct net_device *ndev, struct adapter *padapter =3D rtw_netdev_priv(ndev); struct security_priv *psecuritypriv =3D &padapter->securitypriv; =20 - if (key_index =3D=3D psecuritypriv->dot11PrivacyKeyIndex) - { + if (key_index =3D=3D psecuritypriv->dot11PrivacyKeyIndex) { /* clear the flag of wep default key set. */ psecuritypriv->bWepDefaultKeyIdxSet =3D 0; } @@ -1024,16 +962,14 @@ static int cfg80211_rtw_set_default_key(struct wiphy= *wiphy, struct adapter *padapter =3D rtw_netdev_priv(ndev); struct security_priv *psecuritypriv =3D &padapter->securitypriv; =20 - if ((key_index < WEP_KEYS) && ((psecuritypriv->dot11PrivacyAlgrthm =3D=3D= _WEP40_) || (psecuritypriv->dot11PrivacyAlgrthm =3D=3D _WEP104_))) /* set = wep default key */ - { + if ((key_index < WEP_KEYS) && ((psecuritypriv->dot11PrivacyAlgrthm =3D=3D= _WEP40_) || (psecuritypriv->dot11PrivacyAlgrthm =3D=3D _WEP104_))) { /* se= t wep default key */ psecuritypriv->ndisencryptstatus =3D Ndis802_11Encryption1Enabled; =20 psecuritypriv->dot11PrivacyKeyIndex =3D key_index; =20 psecuritypriv->dot11PrivacyAlgrthm =3D _WEP40_; psecuritypriv->dot118021XGrpPrivacy =3D _WEP40_; - if (psecuritypriv->dot11DefKeylen[key_index] =3D=3D 13) - { + if (psecuritypriv->dot11DefKeylen[key_index] =3D=3D 13) { psecuritypriv->dot11PrivacyAlgrthm =3D _WEP104_; psecuritypriv->dot118021XGrpPrivacy =3D _WEP104_; } @@ -1071,9 +1007,7 @@ static int cfg80211_rtw_get_station(struct wiphy *wip= hy, =20 /* for infra./P2PClient mode */ if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) - && check_fwstate(pmlmepriv, _FW_LINKED) - ) - { + && check_fwstate(pmlmepriv, _FW_LINKED)) { struct wlan_network *cur_network =3D &(pmlmepriv->cur_network); =20 if (memcmp((u8 *)mac, cur_network->network.mac_address, ETH_ALEN)) { @@ -1099,9 +1033,7 @@ static int cfg80211_rtw_get_station(struct wiphy *wip= hy, if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) || check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) || check_fwstate(pmlmepriv, WIFI_AP_STATE)) - && check_fwstate(pmlmepriv, _FW_LINKED) - ) - { + && check_fwstate(pmlmepriv, _FW_LINKED)) { /* TODO: should acquire station info... */ } =20 @@ -1121,8 +1053,7 @@ static int cfg80211_rtw_change_iface(struct wiphy *wi= phy, struct mlme_ext_priv *pmlmeext =3D &(padapter->mlmeextpriv); int ret =3D 0; =20 - if (adapter_to_dvobj(padapter)->processing_dev_remove =3D=3D true) - { + if (adapter_to_dvobj(padapter)->processing_dev_remove =3D=3D true) { ret =3D -EPERM; goto exit; } @@ -1141,8 +1072,7 @@ static int cfg80211_rtw_change_iface(struct wiphy *wi= phy, =20 old_type =3D rtw_wdev->iftype; =20 - if (old_type !=3D type) - { + if (old_type !=3D type) { pmlmeext->action_public_rxseq =3D 0xffff; pmlmeext->action_public_dialog_token =3D 0xff; } @@ -1164,8 +1094,7 @@ static int cfg80211_rtw_change_iface(struct wiphy *wi= phy, =20 rtw_wdev->iftype =3D type; =20 - if (rtw_set_802_11_infrastructure_mode(padapter, networkType) =3D=3D fals= e) - { + if (rtw_set_802_11_infrastructure_mode(padapter, networkType) =3D=3D fals= e) { rtw_wdev->iftype =3D old_type; ret =3D -EPERM; goto exit; @@ -1230,9 +1159,7 @@ void rtw_cfg80211_surveydone_event_callback(struct ad= apter *padapter) =20 /* report network only if the current channel set contains the channel t= o which this network belongs */ if (rtw_ch_set_search_ch(padapter->mlmeextpriv.channel_set, pnetwork->ne= twork.configuration.ds_config) >=3D 0 - && true =3D=3D rtw_validate_ssid(&(pnetwork->network.ssid)) - ) - { + && true =3D=3D rtw_validate_ssid(&(pnetwork->network.ssid))) { /* ev =3Dtranslate_scan(padapter, a, pnetwork, ev, stop); */ rtw_cfg80211_inform_bss(padapter, pnetwork); } @@ -1249,13 +1176,10 @@ static int rtw_cfg80211_set_probe_req_wpsp2pie(stru= ct adapter *padapter, char *b u8 *wps_ie; struct mlme_priv *pmlmepriv =3D &(padapter->mlmepriv); =20 - if (len > 0) - { + if (len > 0) { wps_ie =3D rtw_get_wps_ie(buf, len, NULL, &wps_ielen); - if (wps_ie) - { - if (pmlmepriv->wps_probe_req_ie) - { + if (wps_ie) { + if (pmlmepriv->wps_probe_req_ie) { pmlmepriv->wps_probe_req_ie_len =3D 0; kfree(pmlmepriv->wps_probe_req_ie); pmlmepriv->wps_probe_req_ie =3D NULL; @@ -1307,10 +1231,8 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy pwdev_priv->scan_request =3D request; spin_unlock_bh(&pwdev_priv->scan_req_lock); =20 - if (check_fwstate(pmlmepriv, WIFI_AP_STATE) =3D=3D true) - { - if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS|_FW_UNDER_SURVEY|_FW_UNDER_L= INKING) =3D=3D true) - { + if (check_fwstate(pmlmepriv, WIFI_AP_STATE) =3D=3D true) { + if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS|_FW_UNDER_SURVEY|_FW_UNDER_L= INKING) =3D=3D true) { need_indicate_scan_done =3D true; goto check_need_indicate_scan_done; } @@ -1333,15 +1255,13 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy goto check_need_indicate_scan_done; } =20 - if (pmlmepriv->LinkDetectInfo.bBusyTraffic =3D=3D true) - { + if (pmlmepriv->LinkDetectInfo.bBusyTraffic =3D=3D true) { static unsigned long lastscantime =3D 0; unsigned long passtime; =20 passtime =3D jiffies_to_msecs(jiffies - lastscantime); lastscantime =3D jiffies; - if (passtime > 12000) - { + if (passtime > 12000) { need_indicate_scan_done =3D true; goto check_need_indicate_scan_done; } @@ -1380,9 +1300,7 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy } else if (request->n_channels <=3D 4) { for (j =3D request->n_channels - 1; j >=3D 0; j--) for (i =3D 0; i < survey_times; i++) - { memcpy(&ch[j*survey_times+i], &ch[j], sizeof(struct rtw_ieee80211_chann= el)); - } _status =3D rtw_sitesurvey_cmd(padapter, ssid, RTW_SSID_SCAN_AMOUNT, ch,= survey_times * request->n_channels); } else { _status =3D rtw_sitesurvey_cmd(padapter, ssid, RTW_SSID_SCAN_AMOUNT, NUL= L, 0); @@ -1391,14 +1309,11 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy =20 =20 if (_status =3D=3D false) - { ret =3D -1; - } =20 check_need_indicate_scan_done: kfree(ssid); - if (need_indicate_scan_done) - { + if (need_indicate_scan_done) { rtw_cfg80211_surveydone_event_callback(padapter); rtw_cfg80211_indicate_scan_done(padapter, false); } @@ -1424,9 +1339,7 @@ static int rtw_cfg80211_set_wpa_version(struct securi= ty_priv *psecuritypriv, u32 =20 =20 if (wpa_version & (NL80211_WPA_VERSION_1 | NL80211_WPA_VERSION_2)) - { psecuritypriv->ndisauthtype =3D Ndis802_11AuthModeWPAPSK; - } =20 return 0; =20 @@ -1585,8 +1498,7 @@ static int rtw_cfg80211_set_wpa_ie(struct adapter *pa= dapter, u8 *pie, size_t iel if (pairwise_cipher =3D=3D 0) pairwise_cipher =3D WPA_CIPHER_NONE; =20 - switch (group_cipher) - { + switch (group_cipher) { case WPA_CIPHER_NONE: padapter->securitypriv.dot118021XGrpPrivacy =3D _NO_PRIVACY_; padapter->securitypriv.ndisencryptstatus =3D Ndis802_11EncryptionDisabl= ed; @@ -1609,8 +1521,7 @@ static int rtw_cfg80211_set_wpa_ie(struct adapter *pa= dapter, u8 *pie, size_t iel break; } =20 - switch (pairwise_cipher) - { + switch (pairwise_cipher) { case WPA_CIPHER_NONE: padapter->securitypriv.dot11PrivacyAlgrthm =3D _NO_PRIVACY_; padapter->securitypriv.ndisencryptstatus =3D Ndis802_11EncryptionDisabl= ed; @@ -1731,8 +1642,7 @@ static int cfg80211_rtw_leave_ibss(struct wiphy *wiph= y, struct net_device *ndev) =20 rtw_wdev->iftype =3D NL80211_IFTYPE_STATION; =20 - if (rtw_set_802_11_infrastructure_mode(padapter, Ndis802_11Infrastructur= e) =3D=3D false) - { + if (rtw_set_802_11_infrastructure_mode(padapter, Ndis802_11Infrastructur= e) =3D=3D false) { rtw_wdev->iftype =3D old_type; ret =3D -EPERM; goto leave_ibss; @@ -1792,9 +1702,8 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, = struct net_device *ndev, ret =3D -EBUSY; goto exit; } - if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) =3D=3D true) { + if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) =3D=3D true) rtw_scan_abort(padapter); - } =20 psecuritypriv->ndisencryptstatus =3D Ndis802_11EncryptionDisabled; psecuritypriv->dot11PrivacyAlgrthm =3D _NO_PRIVACY_; @@ -2287,9 +2196,8 @@ static int rtw_cfg80211_add_monitor_if(struct adapter= *padapter, char *name, str mon_ndev->ieee80211_ptr =3D mon_wdev; =20 ret =3D cfg80211_register_netdevice(mon_ndev); - if (ret) { + if (ret) goto out; - } =20 *ndev =3D pwdev_priv->pmon_ndev =3D mon_ndev; memcpy(pwdev_priv->ifname_mon, name, IFNAMSIZ+1); @@ -2402,11 +2310,10 @@ static int rtw_add_beacon(struct adapter *adapter, = const u8 *head, size_t head_l rtw_ies_remove_ie(pbuf, &len, _BEACON_IE_OFFSET_, WLAN_EID_VENDOR_SPECIFI= C, P2P_OUI, 4); rtw_ies_remove_ie(pbuf, &len, _BEACON_IE_OFFSET_, WLAN_EID_VENDOR_SPECIFI= C, WFD_OUI, 4); =20 - if (rtw_check_beacon_data(adapter, pbuf, len) =3D=3D _SUCCESS) { + if (rtw_check_beacon_data(adapter, pbuf, len) =3D=3D _SUCCESS) ret =3D 0; - } else { + else ret =3D -EINVAL; - } =20 =20 kfree(pbuf); --=20 2.36.1