From nobody Sun Feb 8 15:28:40 2026 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B33D1346AD4 for ; Fri, 6 Feb 2026 07:55:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770364524; cv=none; b=R9BcKJLVoY+z8Lvh7PpWWsMo5PPEWqfp/lMU3wSZCygpQGBeWVhfacrGb+VrZV1yzq8D89P0bQWFcsTrsFY3RT2bfk/WKY3bC2lS+Qi3Z7C9n0v3qLCeOMFSqYBhhIrOVvgpeh8VwcJyLTF4w0qo4Ax2ejn7mjgGj0oSIvrafWk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770364524; c=relaxed/simple; bh=bEegYQOu4A7EcKMtJgomMcTEiuyvW0At8tUp6CikilY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CR0RoHI9BpbjPavPj4bwzgPCpV4xyNbSB5P16rLWQNVFNxaESw28N6W1BWrDWRI+/XsrbdaP5SFGX0ZSnn2KmjOZY05fZ0JkmGQ38f4iOxZrWQsVeqJGxMu5Lp9CHSt8wPIJRGBSeZmhCqcdssp6IGjUGti0amyQ0Lzc+Jk/tr8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gspT+ScT; arc=none smtp.client-ip=209.85.221.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gspT+ScT" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-4327790c4e9so1009816f8f.2 for ; Thu, 05 Feb 2026 23:55:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770364518; x=1770969318; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2ILS4KTwtC34WRtTTMDI56fcXf+P837XzR+TxGW/TgY=; b=gspT+ScTPblT/jehHgYYNi8+UEH/rfP12cvvi38aPvPQWDpmv8XoEMTWhC/Xj5c4Gy v2lopoPBmO3/u64Oh4oQK9AgzUJ+t7u4Jau52tu0DIX0N6rEvBi4HUKKd8VCXMEqgDni xUUZFl/e90fujq80APcjrznoUKoBRG9KI8gsGcHG9TSLLVXuhVPXfWNAos4C3E0SlXt6 EqsKAnU462FmnJ1p/kn6SGXjZkjiMsKvOkS/9r6ZbQ85MHchkIVUihCqfrQ38iLCz4X7 6nHfTIZaeME137XqXFLxAOVeidRhmBEHVA5TAeM26qgI+5QDNAHld1rP9eWPDrLuUPnv 3neA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770364518; x=1770969318; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=2ILS4KTwtC34WRtTTMDI56fcXf+P837XzR+TxGW/TgY=; b=snoHFiXYHxSfp8kKFqBnSLj8RtHq2c/IT5yRwEvgTMf8yD/GCxHTKOwDTuulke6+2K YDJ/W609oCHMiG2rftKQ4WRNbRONPzX+trpVYEhRF4ilW0kAK0iUH/JEWXFVz4AukBc2 Wi6WV7awvFjdubtgZQE1MDr3ZAtbg7gsPZHEBABh8vAeU6EGR2k0ENy5/rxFlrf2BeRJ cMONfUCEXmNtBerCiDDJk/8urKcIKjtswH5UmSXu0TME3ZCvKkGmAzGs6/jBb+5p9+2W 7WYFPswrIBC4xdBTL7l5PcV2xQfNVCi101keRSgxJoiaK1nPSjgOGY9gynUYKPn13BLp xRig== X-Forwarded-Encrypted: i=1; AJvYcCUyMbiM/+rMDV8f48u6Q39fOQShM8N/nA/oZQLX1I1x+yI8XHByCmspQzfWfT9dY0nmF4/8ig2r2vTuG8s=@vger.kernel.org X-Gm-Message-State: AOJu0YwN7OV8UpHeSArd+YlMTfUfNCujTWZ8HK5Jta1AM+9NI/KTo2mU bfLaOWpaSM2Cg+VLYg/56Rt3FdBdGOPt0noCZ2eI1p/9OQsfDfC2UyI= X-Gm-Gg: AZuq6aKZygzO40HaLksGChFbn4sazBTBV3Z6OkG4Ut2KjfHu9ozfRGTwNwhQMLEO+8w iJXei4vwDSuTRV5ax89soCsaRvhwDkR1PeL8QWgHQtj4HnGIovieklh98P3VAGi/kXijop91yNR YEJ2596AXE5xWEr25ewoVvYBbdA37UeYLxWOlBIrUKcCm0NZh0/ScOlE4AOi2Te9QtWay4jaO7p 1bJ3x/UhWU804OF7yoQaw3LMifj4ULL3QC+5XCg9vj7YbP48EoxaeNVayua25uFMV4fvor/Rw2G 50js+l0dEnm/9nxSfZMMDsU/78L86CZ6BhrSzXXma3R3qPntVBkp+/gKf+WoUGpY0PXEKht15ww 386wv+IqEFePo5D4boBFa611fdYlj//z7drwVp4PtcT2+GSGwKNw9fXhFg1GGSZF2St3HX1aeyN NSP/s+EoIRTF30T/LQbqLqKY7bKm64BuFGzRRTQxe9Qz9e9EinJIhTJP6FbeXnH2M= X-Received: by 2002:a05:6000:22c8:b0:435:b068:d3d2 with SMTP id ffacd0b85a97d-436293b245amr2509395f8f.57.1770364518234; Thu, 05 Feb 2026 23:55:18 -0800 (PST) Received: from LGPC ([31.223.131.124]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-436296bd3b8sm3836039f8f.11.2026.02.05.23.55.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 23:55:17 -0800 (PST) From: lukagejak5@gmail.com X-Google-Original-From: luka.gejak@linux.dev To: Greg Kroah-Hartman Cc: Dan Carpenter , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Luka Gejak Subject: [PATCH v2 15/26] staging: rtl8723bs: os_dep: fix line lengths in ioctl_cfg80211.c Date: Fri, 6 Feb 2026 08:54:28 +0100 Message-ID: <20260206075439.103287-16-luka.gejak@linux.dev> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260206075439.103287-1-luka.gejak@linux.dev> References: <20260206075439.103287-1-luka.gejak@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Luka Gejak Break long lines exceeding 100 characters to comply with kernel coding style. Signed-off-by: Luka Gejak --- .../staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 134 ++++++++++++------ 1 file changed, 94 insertions(+), 40 deletions(-) diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/st= aging/rtl8723bs/os_dep/ioctl_cfg80211.c index aacc97bbf171..5044df543bd5 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c @@ -125,8 +125,10 @@ static struct ieee80211_supported_band *rtw_spt_band_a= lloc( if (!spt_band) goto exit; =20 - spt_band->channels =3D (struct ieee80211_channel *)(((u8 *)spt_band) + si= zeof(struct ieee80211_supported_band)); - spt_band->bitrates =3D (struct ieee80211_rate *)(((u8 *)spt_band->channel= s) + sizeof(struct ieee80211_channel) * n_channels); + spt_band->channels =3D (struct ieee80211_channel *)(((u8 *)spt_band) + + sizeof(struct ieee80211_supported_band)); + spt_band->bitrates =3D (struct ieee80211_rate *)(((u8 *)spt_band->channel= s) + + sizeof(struct ieee80211_channel) * n_channels); spt_band->band =3D band; spt_band->n_channels =3D n_channels; spt_band->n_bitrates =3D n_bitrates; @@ -205,7 +207,8 @@ int rtw_ieee80211_channel_to_frequency(int chan) } =20 #define MAX_BSSINFO_LEN 1000 -struct cfg80211_bss *rtw_cfg80211_inform_bss(struct adapter *padapter, str= uct wlan_network *pnetwork) +struct cfg80211_bss *rtw_cfg80211_inform_bss(struct adapter *padapter, + struct wlan_network *pnetwork) { struct ieee80211_channel *notify_channel; struct cfg80211_bss *bss =3D NULL; @@ -246,7 +249,10 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(struct ad= apter *padapter, struct wl u32 wpsielen =3D 0; u8 *wpsie =3D NULL; =20 - wpsie =3D rtw_get_wps_ie(pnetwork->network.ies + _FIXED_IE_LENGTH_, pnet= work->network.ie_length - _FIXED_IE_LENGTH_, NULL, &wpsielen); + u8 *ies =3D pnetwork->network.ies + _FIXED_IE_LENGTH_; + uint ie_len =3D pnetwork->network.ie_length - _FIXED_IE_LENGTH_; + + wpsie =3D rtw_get_wps_ie(ies, ie_len, NULL, &wpsielen); =20 if (wpsie && wpsielen > 0) psr =3D rtw_get_wps_attr_content(wpsie, wpsielen, WPS_ATTR_SELECTED_REG= ISTRAR, (u8 *)(&sr), NULL); @@ -275,9 +281,13 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(struct ad= apter *padapter, struct wl /* We've set wiphy's signal_type as CFG80211_SIGNAL_TYPE_MBM: signal stre= ngth in mBm (100*dBm) */ if (check_fwstate(pmlmepriv, _FW_LINKED) =3D=3D true && is_same_network(&pmlmepriv->cur_network.network, &pnetwork->network, = 0)) { - notify_signal =3D 100 * translate_percentage_to_dbm(padapter->recvpriv.s= ignal_strength);/* dbm */ + u8 sig =3D padapter->recvpriv.signal_strength; + + notify_signal =3D 100 * translate_percentage_to_dbm(sig); } else { - notify_signal =3D 100 * translate_percentage_to_dbm(pnetwork->network.ph= y_info.signal_strength);/* dbm */ + u8 sig =3D pnetwork->network.phy_info.signal_strength; + + notify_signal =3D 100 * translate_percentage_to_dbm(sig); } =20 buf =3D kzalloc(MAX_BSSINFO_LEN, GFP_ATOMIC); @@ -378,9 +388,10 @@ void rtw_cfg80211_ibss_indicate_connect(struct adapter= *padapter) rtw_warn_on(1); return; } - if (!memcmp(&(scanned->network.ssid), &(pnetwork->ssid), sizeof(struct = ndis_802_11_ssid)) - && !memcmp(scanned->network.mac_address, pnetwork->mac_address, ETH_AL= EN) - ) + if (!memcmp(&scanned->network.ssid, &pnetwork->ssid, + sizeof(struct ndis_802_11_ssid)) && + !memcmp(scanned->network.mac_address, + pnetwork->mac_address, ETH_ALEN)) rtw_cfg80211_inform_bss(padapter, scanned); else rtw_warn_on(1); @@ -491,18 +502,24 @@ void rtw_cfg80211_indicate_disconnect(struct adapter = *padapter) } } =20 -static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, struct i= eee_param *param, u32 param_len) +static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, + struct ieee_param *param, + u32 param_len) { int ret =3D 0; u32 wep_key_idx, wep_key_len; + u32 key_len; struct sta_info *psta =3D NULL, *pbcmc_sta =3D NULL; struct adapter *padapter =3D rtw_netdev_priv(dev); struct mlme_priv *pmlmepriv =3D &padapter->mlmepriv; struct security_priv *psecuritypriv =3D &(padapter->securitypriv); struct sta_priv *pstapriv =3D &padapter->stapriv; - char *grpkey =3D padapter->securitypriv.dot118021XGrpKey[param->u.crypt.i= dx].skey; - char *txkey =3D padapter->securitypriv.dot118021XGrptxmickey[param->u.cry= pt.idx].skey; - char *rxkey =3D padapter->securitypriv.dot118021XGrprxmickey[param->u.cry= pt.idx].skey; + char *grpkey =3D psecuritypriv->dot118021XGrpKey[param->u.crypt.idx].skey; + char *txkey =3D psecuritypriv->dot118021XGrptxmickey[param->u.crypt.idx].= skey; + char *rxkey =3D psecuritypriv->dot118021XGrprxmickey[param->u.crypt.idx].= skey; + + /* Clamp key_len to max 16 */ + key_len =3D min_t(u32, param->u.crypt.key_len, 16); =20 param->u.crypt.err =3D 0; param->u.crypt.alg[IEEE_CRYPT_ALG_NAME_LEN - 1] =3D '\0'; @@ -602,12 +619,15 @@ static int rtw_cfg80211_ap_set_encryption(struct net_= device *dev, struct ieee_pa =20 psecuritypriv->dot11PrivacyAlgrthm =3D psecuritypriv->dot118021XGrpPriv= acy;/* */ =20 - rtw_ap_set_group_key(padapter, param->u.crypt.key, psecuritypriv->dot11= 8021XGrpPrivacy, param->u.crypt.idx); + rtw_ap_set_group_key(padapter, param->u.crypt.key, + psecuritypriv->dot118021XGrpPrivacy, + param->u.crypt.idx); =20 pbcmc_sta =3D rtw_get_bcmc_stainfo(padapter); if (pbcmc_sta) { pbcmc_sta->ieee8021x_blocked =3D false; - pbcmc_sta->dot118021XPrivacy =3D psecuritypriv->dot118021XGrpPrivacy;/= * rx will use bmc_sta's dot118021XPrivacy */ + /* rx will use bmc_sta's dot118021XPrivacy */ + pbcmc_sta->dot118021XPrivacy =3D psecuritypriv->dot118021XGrpPrivacy; } } =20 @@ -617,7 +637,8 @@ static int rtw_cfg80211_ap_set_encryption(struct net_de= vice *dev, struct ieee_pa 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)); + memcpy(psta->dot118021x_UncstKey.skey, + param->u.crypt.key, key_len); =20 if (strcmp(param->u.crypt.alg, "WEP") =3D=3D 0) { psta->dot118021XPrivacy =3D _WEP40_; @@ -646,7 +667,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_de= vice *dev, struct ieee_pa =20 } 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)); + memcpy(grpkey, param->u.crypt.key, key_len); =20 psecuritypriv->dot118021XGrpPrivacy =3D _WEP40_; if (param->u.crypt.key_len =3D=3D 13) @@ -654,7 +675,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_de= vice *dev, struct ieee_pa } 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)); + memcpy(grpkey, param->u.crypt.key, key_len); =20 /* set mic key */ memcpy(txkey, &(param->u.crypt.key[16]), 8); @@ -665,7 +686,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_de= vice *dev, struct ieee_pa } 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)); + memcpy(grpkey, param->u.crypt.key, key_len); } else { psecuritypriv->dot118021XGrpPrivacy =3D _NO_PRIVACY_; } @@ -676,12 +697,16 @@ static int rtw_cfg80211_ap_set_encryption(struct net_= device *dev, struct ieee_pa =20 psecuritypriv->dot11PrivacyAlgrthm =3D psecuritypriv->dot118021XGrpPri= vacy;/* */ =20 - rtw_ap_set_group_key(padapter, param->u.crypt.key, psecuritypriv->dot1= 18021XGrpPrivacy, param->u.crypt.idx); + rtw_ap_set_group_key(padapter, param->u.crypt.key, + psecuritypriv->dot118021XGrpPrivacy, + param->u.crypt.idx); =20 pbcmc_sta =3D rtw_get_bcmc_stainfo(padapter); if (pbcmc_sta) { pbcmc_sta->ieee8021x_blocked =3D false; - pbcmc_sta->dot118021XPrivacy =3D psecuritypriv->dot118021XGrpPrivacy;= /* rx will use bmc_sta's dot118021XPrivacy */ + /* rx will use bmc_sta's dot118021XPrivacy */ + pbcmc_sta->dot118021XPrivacy =3D + psecuritypriv->dot118021XGrpPrivacy; } } } @@ -692,15 +717,20 @@ static int rtw_cfg80211_ap_set_encryption(struct net_= device *dev, struct ieee_pa return ret; } =20 -static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee= _param *param, u32 param_len) +static int rtw_cfg80211_set_encryption(struct net_device *dev, + struct ieee_param *param, u32 param_len) { int ret =3D 0; u8 max_idx; u32 wep_key_idx, wep_key_len; + u32 key_len; struct adapter *padapter =3D rtw_netdev_priv(dev); struct mlme_priv *pmlmepriv =3D &padapter->mlmepriv; struct security_priv *psecuritypriv =3D &padapter->securitypriv; =20 + /* Clamp key_len to max 16 */ + key_len =3D min_t(u32, param->u.crypt.key_len, 16); + param->u.crypt.err =3D 0; param->u.crypt.alg[IEEE_CRYPT_ALG_NAME_LEN - 1] =3D '\0'; =20 @@ -780,7 +810,8 @@ static int rtw_cfg80211_set_encryption(struct net_devic= e *dev, struct ieee_param =20 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)); + memcpy(psta->dot118021x_UncstKey.skey, + param->u.crypt.key, key_len); =20 if (strcmp(param->u.crypt.alg, "TKIP") =3D=3D 0) { /* set mic key */ memcpy(psta->dot11tkiptxmickey.skey, &(param->u.crypt.key[16]), 8); @@ -793,17 +824,27 @@ static int rtw_cfg80211_set_encryption(struct net_dev= ice *dev, struct ieee_param 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) { - 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); + u8 grp_idx =3D param->u.crypt.idx; + struct security_priv *sec =3D psecuritypriv; + + memcpy(sec->dot118021XGrpKey[grp_idx].skey, + param->u.crypt.key, key_len); + memcpy(sec->dot118021XGrptxmickey[grp_idx].skey, + ¶m->u.crypt.key[16], 8); + memcpy(sec->dot118021XGrprxmickey[grp_idx].skey, + ¶m->u.crypt.key[24], 8); padapter->securitypriv.binstallGrpkey =3D true; =20 - padapter->securitypriv.dot118021XGrpKeyid =3D param->u.crypt.idx; - rtw_set_key(padapter, &padapter->securitypriv, param->u.crypt.idx, 1= , true); + padapter->securitypriv.dot118021XGrpKeyid =3D grp_idx; + rtw_set_key(padapter, &padapter->securitypriv, + grp_idx, 1, true); } 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)); - padapter->securitypriv.dot11wBIPKeyid =3D param->u.crypt.idx; + u8 idx =3D param->u.crypt.idx; + + memcpy(psecuritypriv->dot11wBIPKey[idx].skey, + param->u.crypt.key, key_len); + padapter->securitypriv.dot11wBIPKeyid =3D idx; padapter->securitypriv.binstallBIPkey =3D true; } } @@ -940,8 +981,10 @@ 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; + u32 alg =3D psecuritypriv->dot11PrivacyAlgrthm; + bool is_wep =3D (alg =3D=3D _WEP40_) || (alg =3D=3D _WEP104_); =20 - if ((key_index < WEP_KEYS) && ((psecuritypriv->dot11PrivacyAlgrthm =3D=3D= _WEP40_) || (psecuritypriv->dot11PrivacyAlgrthm =3D=3D _WEP104_))) { /* se= t wep default key */ + if ((key_index < WEP_KEYS) && is_wep) { /* set wep default key */ psecuritypriv->ndisencryptstatus =3D Ndis802_11Encryption1Enabled; =20 psecuritypriv->dot11PrivacyKeyIndex =3D key_index; @@ -953,7 +996,8 @@ static int cfg80211_rtw_set_default_key(struct wiphy *w= iphy, psecuritypriv->dot118021XGrpPrivacy =3D _WEP104_; } =20 - psecuritypriv->bWepDefaultKeyIdxSet =3D 1; /* set the flag to represent = that wep default key has been set */ + /* set the flag to represent that wep default key has been set */ + psecuritypriv->bWepDefaultKeyIdxSet =3D 1; } =20 return 0; @@ -1137,7 +1181,8 @@ void rtw_cfg80211_surveydone_event_callback(struct ad= apter *padapter) pnetwork =3D list_entry(plist, struct wlan_network, list); =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 + if (rtw_ch_set_search_ch(padapter->mlmeextpriv.channel_set, + pnetwork->network.configuration.ds_config) >=3D 0 && true =3D=3D rtw_validate_ssid(&(pnetwork->network.ssid))) { /* ev =3Dtranslate_scan(padapter, a, pnetwork, ev, stop); */ rtw_cfg80211_inform_bss(padapter, pnetwork); @@ -1277,7 +1322,8 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy 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_= channel)); - _status =3D rtw_sitesurvey_cmd(padapter, ssid, RTW_SSID_SCAN_AMOUNT, ch,= survey_times * request->n_channels); + _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); } @@ -1861,10 +1907,14 @@ static int cfg80211_rtw_set_pmksa(struct wiphy *wip= hy, } =20 if (!blInserted) { - memcpy(psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].Bssid, (u8 *)= pmksa->bssid, ETH_ALEN); - memcpy(psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].PMKID, (u8 *)= pmksa->pmkid, WLAN_PMKID_LEN); + u8 idx =3D psecuritypriv->PMKIDIndex; + + memcpy(psecuritypriv->PMKIDList[idx].Bssid, + (u8 *)pmksa->bssid, ETH_ALEN); + memcpy(psecuritypriv->PMKIDList[idx].PMKID, + (u8 *)pmksa->pmkid, WLAN_PMKID_LEN); =20 - psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].bUsed =3D true; + psecuritypriv->PMKIDList[idx].bUsed =3D true; psecuritypriv->PMKIDIndex++; if (psecuritypriv->PMKIDIndex =3D=3D 16) psecuritypriv->PMKIDIndex =3D 0; @@ -1933,7 +1983,9 @@ void rtw_cfg80211_indicate_sta_assoc(struct adapter *= padapter, u8 *pmgmt_frame, } } =20 -void rtw_cfg80211_indicate_sta_disassoc(struct adapter *padapter, unsigned= char *da, unsigned short reason) +void rtw_cfg80211_indicate_sta_disassoc(struct adapter *padapter, + unsigned char *da, + unsigned short reason) { struct net_device *ndev =3D padapter->pnetdev; =20 @@ -2112,7 +2164,8 @@ static const struct net_device_ops rtw_cfg80211_monit= or_if_ops =3D { .ndo_start_xmit =3D rtw_cfg80211_monitor_if_xmit_entry, }; =20 -static int rtw_cfg80211_add_monitor_if(struct adapter *padapter, char *nam= e, struct net_device **ndev) +static int rtw_cfg80211_add_monitor_if(struct adapter *padapter, char *nam= e, + struct net_device **ndev) { int ret =3D 0; struct net_device *mon_ndev =3D NULL; @@ -2245,7 +2298,8 @@ static int cfg80211_rtw_del_virtual_intf(struct wiphy= *wiphy, return ret; } =20 -static int rtw_add_beacon(struct adapter *adapter, const u8 *head, size_t = head_len, const u8 *tail, size_t tail_len) +static int rtw_add_beacon(struct adapter *adapter, const u8 *head, + size_t head_len, const u8 *tail, size_t tail_len) { int ret =3D 0; u8 *pbuf =3D NULL; --=20 2.52.0