lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2025081019-expansion-outhouse-d652@gregkh>
Date: Sun, 10 Aug 2025 08:56:38 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Yao-Wen Chang <changyaowen19980629@...il.com>
Cc: linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: rtl8723bs: refactor code for style compliance

On Sun, Aug 10, 2025 at 11:26:46AM +0800, Yao-Wen Chang wrote:
> From: Yao-Wen-Chang <changyaowen19980629@...il.com>
> 
> This patch refactors the rtl8723bs staging driver to improve code style:
> 1. Ensure lines are within 100 characters per line for readability.
> 2. Add spaces around operators for consistency with kernel coding style.
> 3. Convert camelCase variables to snake_case for uniformity.
> 
> Signed-off-by: Yao-Wen Chang <changyaowen19980629@...il.com>
> ---
>  drivers/staging/rtl8723bs/core/rtw_ap.c  | 289 ++++++++++-------------
>  drivers/staging/rtl8723bs/core/rtw_cmd.c | 159 ++++++++-----
>  2 files changed, 221 insertions(+), 227 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c
> index b2e7e7267aa4..2c5286062a06 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_ap.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
> @@ -258,11 +258,9 @@ void expire_timeout_chk(struct adapter *padapter)
>  		} else {
>  			/* TODO: Aging mechanism to digest frames in sleep_q to */
>  			/* avoid running out of xmitframe */
> -			if (psta->sleepq_len > (NR_XMITFRAME / pstapriv->asoc_list_cnt)
> -				&& padapter->xmitpriv.free_xmitframe_cnt < ((
> -					NR_XMITFRAME / pstapriv->asoc_list_cnt
> -				) / 2)
> -			)
> +			if (psta->sleepq_len > (NR_XMITFRAME / pstapriv->asoc_list_cnt) &&
> +			    (padapter->xmitpriv.free_xmitframe_cnt < ((NR_XMITFRAME /
> +			   pstapriv->asoc_list_cnt) / 2)))
>  				wakeup_sta_to_xmit(padapter, psta);
>  		}
>  	}
> @@ -322,7 +320,7 @@ void expire_timeout_chk(struct adapter *padapter)
>  
>  void add_RATid(struct adapter *padapter, struct sta_info *psta, u8 rssi_level)
>  {
> -	unsigned char sta_band = 0, shortGIrate = false;
> +	unsigned char sta_band = 0, short_GI_rate = false;
>  	unsigned int tx_ra_bitmap = 0;
>  	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
>  	struct wlan_bssid_ex
> @@ -337,7 +335,7 @@ void add_RATid(struct adapter *padapter, struct sta_info *psta, u8 rssi_level)
>  	rtw_hal_update_sta_rate_mask(padapter, psta);
>  	tx_ra_bitmap = psta->ra_mask;
>  
> -	shortGIrate = query_ra_short_GI(psta);
> +	short_GI_rate = query_ra_short_GI(psta);
>  
>  	if (pcur_network->configuration.ds_config > 14) {
>  		sta_band |= WIRELESS_INVALID;
> @@ -360,7 +358,7 @@ void add_RATid(struct adapter *padapter, struct sta_info *psta, u8 rssi_level)
>  
>  		arg[0] = psta->mac_id;
>  		arg[1] = psta->raid;
> -		arg[2] = shortGIrate;
> +		arg[2] = short_GI_rate;
>  		arg[3] = psta->init_rate;
>  
>  		rtw_hal_add_ra_tid(padapter, tx_ra_bitmap, arg, rssi_level);
> @@ -370,7 +368,7 @@ void add_RATid(struct adapter *padapter, struct sta_info *psta, u8 rssi_level)
>  void update_bmc_sta(struct adapter *padapter)
>  {
>  	unsigned char network_type;
> -	int supportRateNum = 0;
> +	int support_rate_num = 0;
>  	unsigned int tx_ra_bitmap = 0;
>  	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
>  	struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
> @@ -393,14 +391,15 @@ void update_bmc_sta(struct adapter *padapter)
>  
>  		memset((void *)&psta->sta_stats, 0, sizeof(struct stainfo_stats));
>  
> -		/* psta->dot118021XPrivacy = _NO_PRIVACY_;//!!! remove it, because it has been set before this. */
> +		/* psta->dot118021XPrivacy = _NO_PRIVACY_;
> +		 * //!!! remove it, because it has been set before this.
> +		 */
>  
> -		/* prepare for add_RATid */
> -		supportRateNum = rtw_get_rateset_len((u8 *)&pcur_network->supported_rates);
> +		/* prepare for add_ra_tid */
> +		support_rate_num = rtw_get_rateset_len((u8 *)&pcur_network->supported_rates);
>  		network_type = rtw_check_network_type((u8 *)&pcur_network->supported_rates,
> -						      supportRateNum,
> -						      pcur_network->configuration.ds_config
> -		);
> +						      support_rate_num,
> +						      pcur_network->configuration.ds_config);
>  		if (is_supported_tx_cck(network_type)) {
>  			network_type = WIRELESS_11B;
>  		} else if (network_type == WIRELESS_INVALID) { /*  error handling */
> @@ -438,7 +437,6 @@ void update_bmc_sta(struct adapter *padapter)
>  		spin_lock_bh(&psta->lock);
>  		psta->state = _FW_LINKED;
>  		spin_unlock_bh(&psta->lock);
> -
>  	}
>  }
>  
> @@ -482,13 +480,11 @@ void update_sta_info_apmode(struct adapter *padapter, struct sta_info *psta)
>  		/* check if sta supports rx ampdu */
>  		phtpriv_sta->ampdu_enable = phtpriv_ap->ampdu_enable;
>  
> -		phtpriv_sta->rx_ampdu_min_spacing = (
> -			phtpriv_sta->ht_cap.ampdu_params_info & IEEE80211_HT_CAP_AMPDU_DENSITY
> -		) >> 2;
> +		phtpriv_sta->rx_ampdu_min_spacing = (phtpriv_sta->ht_cap.ampdu_params_info &
> +						     IEEE80211_HT_CAP_AMPDU_DENSITY) >> 2;
>  
>  		/*  bwmode */
> -		if ((
> -			phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info
> +		if ((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info
>  		) & cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH))
>  			psta->bw_mode = CHANNEL_WIDTH_40;
>  		else
> @@ -500,14 +496,12 @@ void update_sta_info_apmode(struct adapter *padapter, struct sta_info *psta)
>  		phtpriv_sta->ch_offset = pmlmeext->cur_ch_offset;
>  
>  		/* check if sta support s Short GI 20M */
> -		if ((
> -			phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info
> +		if ((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info
>  		) & cpu_to_le16(IEEE80211_HT_CAP_SGI_20))
>  			phtpriv_sta->sgi_20m = true;
>  
>  		/* check if sta support s Short GI 40M */
> -		if ((
> -			phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info
> +		if ((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info
>  		) & cpu_to_le16(IEEE80211_HT_CAP_SGI_40)) {
>  			if (psta->bw_mode == CHANNEL_WIDTH_40) /* according to psta->bw_mode */
>  				phtpriv_sta->sgi_40m = true;
> @@ -519,12 +513,12 @@ void update_sta_info_apmode(struct adapter *padapter, struct sta_info *psta)
>  
>  		/*  B0 Config LDPC Coding Capability */
>  		if (TEST_FLAG(phtpriv_ap->ldpc_cap, LDPC_HT_ENABLE_TX) &&
> -		    GET_HT_CAPABILITY_ELE_LDPC_CAP((u8 *)(&phtpriv_sta->ht_cap)))
> +		    GET_HT_CAPABILITY_ELE_LDPC_CAP((u8 *)&phtpriv_sta->ht_cap))
>  			SET_FLAG(cur_ldpc_cap, (LDPC_HT_ENABLE_TX | LDPC_HT_CAP_TX));
>  
>  		/*  B7 B8 B9 Config STBC setting */
>  		if (TEST_FLAG(phtpriv_ap->stbc_cap, STBC_HT_ENABLE_TX) &&
> -		    GET_HT_CAPABILITY_ELE_RX_STBC((u8 *)(&phtpriv_sta->ht_cap)))
> +		    GET_HT_CAPABILITY_ELE_RX_STBC((u8 *)&phtpriv_sta->ht_cap))
>  			SET_FLAG(cur_stbc_cap, (STBC_HT_ENABLE_TX | STBC_HT_CAP_TX));
>  	} else {
>  		phtpriv_sta->ampdu_enable = false;
> @@ -580,11 +574,11 @@ static void update_ap_info(struct adapter *padapter, struct sta_info *psta)
>  		/* phtpriv_ap->ampdu_enable = phtpriv_ap->ampdu_enable; */
>  
>  		/* check if sta support s Short GI 20M */
> -		if ((phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SGI_20))
> +		if (phtpriv_ap->ht_cap.cap_info & cpu_to_le16(IEEE80211_HT_CAP_SGI_20))
>  			phtpriv_ap->sgi_20m = true;
>  
>  		/* check if sta support s Short GI 40M */
> -		if ((phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SGI_40))
> +		if (phtpriv_ap->ht_cap.cap_info & cpu_to_le16(IEEE80211_HT_CAP_SGI_40))
>  			phtpriv_ap->sgi_40m = true;
>  
>  		psta->qos_option = true;
> @@ -627,8 +621,7 @@ static void update_hw_ht_param(struct adapter *padapter)
>  	/*  */
>  	/*  Config SM Power Save setting */
>  	/*  */
> -	pmlmeinfo->SM_PS = (le16_to_cpu(
> -		pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info
> +	pmlmeinfo->SM_PS = (le16_to_cpu(pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info
>  	) & 0x0C) >> 2;
>  
>  	/*  */
> @@ -660,9 +653,11 @@ void start_bss_network(struct adapter *padapter)
>  	cur_bwmode = CHANNEL_WIDTH_20;
>  	cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
>  
> -	/* check if there is wps ie, */
> -	/* if there is wpsie in beacon, the hostapd will update beacon twice when stating hostapd, */
> -	/* and at first time the security ie (RSN/WPA IE) will not include in beacon. */
> +	/* check if there is wps ie,
> +	 * if there is wpsie in beacon, the hostapd will update beacon twice when stating hostapd,
> +	 * and at first time the security ie (RSN/WPA IE) will not include in beacon.
> +	 */
> +
>  	if (!rtw_get_wps_ie(pnetwork->ies + _FIXED_IE_LENGTH_,
>  			    pnetwork->ie_length - _FIXED_IE_LENGTH_, NULL, NULL))
>  		pmlmeext->bstart_bss = true;
> @@ -784,10 +779,7 @@ void start_bss_network(struct adapter *padapter)
>  	rtw_hal_set_hwreg(padapter, HW_VAR_BASIC_RATE, pnetwork->supported_rates);
>  
>  	/* update capability after cur_wireless_mode updated */
> -	update_capinfo(
> -		padapter,
> -		rtw_get_capability((struct wlan_bssid_ex *)pnetwork)
> -	);
> +	update_capinfo(padapter, rtw_get_capability((struct wlan_bssid_ex *)pnetwork));
>  
>  	if (pmlmeext->bstart_bss) {
>  		update_beacon(padapter, WLAN_EID_TIM, NULL, true);
> @@ -806,14 +798,14 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf,  int len)
>  {
>  	int ret = _SUCCESS;
>  	u8 *p;
> -	u8 *pHT_caps_ie = NULL;
> -	u8 *pHT_info_ie = NULL;
> +	u8 *p_HT_caps_ie = NULL;
> +	u8 *p_HT_info_ie = NULL;
>  	struct sta_info *psta = NULL;
>  	u16 cap, ht_cap = false;
>  	uint ie_len = 0;
>  	int group_cipher, pairwise_cipher;
> -	u8 channel, network_type, supportRate[NDIS_802_11_LENGTH_RATES_EX];
> -	int supportRateNum = 0;
> +	u8 channel, network_type, support_rate[NDIS_802_11_LENGTH_RATES_EX];
> +	int support_rate_num = 0;
>  	u8 OUI1[] = {0x00, 0x50, 0xf2, 0x01};
>  	u8 WMM_PARA_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 0x01};
>  	struct registry_priv *pregistrypriv = &padapter->registrypriv;
> @@ -843,7 +835,9 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf,  int len)
>  	memcpy(pbss_network->mac_address, myid(&padapter->eeprompriv), ETH_ALEN);
>  
>  	/* beacon interval */
> -	p = rtw_get_beacon_interval_from_ie(ie);/* ie + 8;	8: TimeStamp, 2: Beacon Interval 2:Capability */
> +	p = rtw_get_beacon_interval_from_ie(ie); /* ie + 8; 8:
> +						  *TimeStamp, 2: Beacon Interval 2:Capability
> +						  */
>  	/* pbss_network->configuration.beacon_period = le16_to_cpu(*(unsigned short*)p); */
>  	pbss_network->configuration.beacon_period = get_unaligned_le16(p);
>  
> @@ -853,12 +847,11 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf,  int len)
>  	cap = get_unaligned_le16(ie);
>  
>  	/* SSID */
> -	p = rtw_get_ie(
> -		ie + _BEACON_IE_OFFSET_,
> +	p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, 
>  		WLAN_EID_SSID,
>  		&ie_len,
> -		(pbss_network->ie_length - _BEACON_IE_OFFSET_)
> -	);
> +		       pbss_network->ie_length - _BEACON_IE_OFFSET_);
> +
>  	if (p && ie_len > 0) {
>  		memset(&pbss_network->ssid, 0, sizeof(struct ndis_802_11_ssid));
>  		memcpy(pbss_network->ssid.ssid, (p + 2), ie_len);
> @@ -868,52 +861,45 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf,  int len)
>  	/* channel */
>  	channel = 0;
>  	pbss_network->configuration.length = 0;
> -	p = rtw_get_ie(
> -		ie + _BEACON_IE_OFFSET_,
> -		WLAN_EID_DS_PARAMS, &ie_len,
> -		(pbss_network->ie_length - _BEACON_IE_OFFSET_)
> -	);
> +	p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, 
> +		       WLAN_EID_DS_PARAMS,
> +		       &ie_len, 
> +		       (pbss_network->ie_length - _BEACON_IE_OFFSET_));
>  	if (p && ie_len > 0)
>  		channel = *(p + 2);
>  
>  	pbss_network->configuration.ds_config = channel;
>  
> -	memset(supportRate, 0, NDIS_802_11_LENGTH_RATES_EX);
> +	memset(support_rate, 0, NDIS_802_11_LENGTH_RATES_EX);
>  	/*  get supported rates */
> -	p = rtw_get_ie(
> -		ie + _BEACON_IE_OFFSET_,
> +	p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, 
>  		WLAN_EID_SUPP_RATES,
>  		&ie_len,
> -		(pbss_network->ie_length - _BEACON_IE_OFFSET_)
> -	);
> +		       (pbss_network->ie_length - _BEACON_IE_OFFSET_));
>  	if (p) {
> -		memcpy(supportRate, p + 2, ie_len);
> -		supportRateNum = ie_len;
> +		memcpy(support_rate, p + 2, ie_len);
> +		support_rate_num = ie_len;
>  	}
>  
>  	/* get ext_supported rates */
> -	p = rtw_get_ie(
> -		ie + _BEACON_IE_OFFSET_,
> +	p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, 
>  		WLAN_EID_EXT_SUPP_RATES,
>  		&ie_len,
> -		pbss_network->ie_length - _BEACON_IE_OFFSET_
> -	);
> +		       pbss_network->ie_length - _BEACON_IE_OFFSET_);
>  	if (p) {
> -		memcpy(supportRate + supportRateNum, p + 2, ie_len);
> -		supportRateNum += ie_len;
> +		memcpy(support_rate + support_rate_num, p + 2, ie_len);
> +		support_rate_num += ie_len;
>  	}
>  
> -	network_type = rtw_check_network_type(supportRate, supportRateNum, channel);
> +	network_type = rtw_check_network_type(support_rate, support_rate_num, channel);
>  
>  	rtw_set_supported_rate(pbss_network->supported_rates, network_type);
>  
>  	/* parsing ERP_IE */
> -	p = rtw_get_ie(
> -		ie + _BEACON_IE_OFFSET_,
> +	p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, 
>  		WLAN_EID_ERP_INFO,
>  		&ie_len,
> -		(pbss_network->ie_length - _BEACON_IE_OFFSET_)
> -	);
> +		       (pbss_network->ie_length - _BEACON_IE_OFFSET_));
>  	if (p && ie_len > 0)
>  		ERP_IE_handler(padapter, (struct ndis_80211_var_ie *)p);
>  
> @@ -929,15 +915,12 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf,  int len)
>  	group_cipher = 0; pairwise_cipher = 0;
>  	psecuritypriv->wpa2_group_cipher = _NO_PRIVACY_;
>  	psecuritypriv->wpa2_pairwise_cipher = _NO_PRIVACY_;
> -	p = rtw_get_ie(
> -		ie + _BEACON_IE_OFFSET_,
> +	p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, 
>  		WLAN_EID_RSN,
>  		&ie_len,
> -		(pbss_network->ie_length - _BEACON_IE_OFFSET_)
> -	);
> +		       (pbss_network->ie_length - _BEACON_IE_OFFSET_));
>  	if (p && ie_len > 0) {
> -		if (rtw_parse_wpa2_ie(
> -			p,
> +		if (rtw_parse_wpa2_ie(p,
>  			ie_len + 2,
>  			&group_cipher,
>  			&pairwise_cipher,
> @@ -959,15 +942,12 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf,  int len)
>  	psecuritypriv->wpa_group_cipher = _NO_PRIVACY_;
>  	psecuritypriv->wpa_pairwise_cipher = _NO_PRIVACY_;
>  	for (p = ie + _BEACON_IE_OFFSET_; ; p += (ie_len + 2)) {
> -		p = rtw_get_ie(
> -			p,
> +		p = rtw_get_ie(p, 
>  			WLAN_EID_VENDOR_SPECIFIC,
>  			&ie_len,
> -			(pbss_network->ie_length - _BEACON_IE_OFFSET_ - (ie_len + 2))
> -		);
> +			       (pbss_network->ie_length - _BEACON_IE_OFFSET_ - (ie_len + 2)));
>  		if ((p) && (!memcmp(p + 2, OUI1, 4))) {
> -			if (rtw_parse_wpa_ie(
> -				p,
> +			if (rtw_parse_wpa_ie(p,
>  				ie_len + 2,
>  				&group_cipher,
>  				&pairwise_cipher,
> @@ -995,8 +975,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf,  int len)
>  	pmlmepriv->qospriv.qos_option = 0;
>  	if (pregistrypriv->wmm_enable) {
>  		for (p = ie + _BEACON_IE_OFFSET_; ; p += (ie_len + 2)) {
> -			p = rtw_get_ie(
> -				p,
> +			p = rtw_get_ie(p, 
>  				WLAN_EID_VENDOR_SPECIFIC,
>  				&ie_len,
>  				(pbss_network->ie_length - _BEACON_IE_OFFSET_ - (ie_len + 2))
> @@ -1022,27 +1001,25 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf,  int len)
>  	}
>  
>  	/* parsing HT_CAP_IE */
> -	p = rtw_get_ie(
> -		ie + _BEACON_IE_OFFSET_,
> +	p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, 
>  		WLAN_EID_HT_CAPABILITY,
>  		&ie_len,
> -		(pbss_network->ie_length - _BEACON_IE_OFFSET_)
> -	);
> +		       (pbss_network->ie_length - _BEACON_IE_OFFSET_));
>  	if (p && ie_len > 0) {
>  		u8 max_rx_ampdu_factor = 0;
>  		struct ieee80211_ht_cap *pht_cap = (struct ieee80211_ht_cap *)(p + 2);
>  
> -		pHT_caps_ie = p;
> +		p_HT_caps_ie = p;
>  
>  		ht_cap = true;
>  		network_type |= WIRELESS_11_24N;
>  
>  		rtw_ht_use_default_setting(padapter);
>  
> -		if (pmlmepriv->htpriv.sgi_20m == false)
> +		if (!pmlmepriv->htpriv.sgi_20m)
>  			pht_cap->cap_info &= cpu_to_le16(~(IEEE80211_HT_CAP_SGI_20));
>  
> -		if (pmlmepriv->htpriv.sgi_40m == false)
> +		if (!pmlmepriv->htpriv.sgi_40m)
>  			pht_cap->cap_info &= cpu_to_le16(~(IEEE80211_HT_CAP_SGI_40));
>  
>  		if (!TEST_FLAG(pmlmepriv->htpriv.ldpc_cap, LDPC_HT_ENABLE_RX))
> @@ -1054,9 +1031,8 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf,  int len)
>  		if (!TEST_FLAG(pmlmepriv->htpriv.stbc_cap, STBC_HT_ENABLE_RX))
>  			pht_cap->cap_info &= cpu_to_le16(~(IEEE80211_HT_CAP_RX_STBC_3R));
>  
> -		pht_cap->ampdu_params_info &= ~(
> -			IEEE80211_HT_CAP_AMPDU_FACTOR | IEEE80211_HT_CAP_AMPDU_DENSITY
> -		);
> +		pht_cap->ampdu_params_info &= ~(IEEE80211_HT_CAP_AMPDU_FACTOR |
> +						IEEE80211_HT_CAP_AMPDU_DENSITY);
>  
>  		if ((psecuritypriv->wpa_pairwise_cipher & WPA_CIPHER_CCMP) ||
>  		    (psecuritypriv->wpa2_pairwise_cipher & WPA_CIPHER_CCMP)) {
> @@ -1067,13 +1043,12 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf,  int len)
>  						       0x00);
>  		}
>  
> -		rtw_hal_get_def_var(
> -			padapter,
> +		rtw_hal_get_def_var(padapter, 
>  			HW_VAR_MAX_RX_AMPDU_FACTOR,
>  			&max_rx_ampdu_factor
>  		);
> -		pht_cap->ampdu_params_info |= (
> -			IEEE80211_HT_CAP_AMPDU_FACTOR & max_rx_ampdu_factor
> +		pht_cap->ampdu_params_info |=
> +			(IEEE80211_HT_CAP_AMPDU_FACTOR & max_rx_ampdu_factor
>  		); /* set  Max Rx AMPDU size  to 64K */
>  
>  		pht_cap->mcs.rx_mask[0] = 0xff;
> @@ -1083,14 +1058,12 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf,  int len)
>  	}
>  
>  	/* parsing HT_INFO_IE */
> -	p = rtw_get_ie(
> -		ie + _BEACON_IE_OFFSET_,
> +	p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, 
>  		WLAN_EID_HT_OPERATION,
>  		&ie_len,
> -		(pbss_network->ie_length - _BEACON_IE_OFFSET_)
> -	);
> +		       (pbss_network->ie_length - _BEACON_IE_OFFSET_));
>  	if (p && ie_len > 0)
> -		pHT_info_ie = p;
> +		p_HT_info_ie = p;
>  
>  	switch (network_type) {
>  	case WIRELESS_11B:
> @@ -1125,14 +1098,12 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf,  int len)
>  		if (pregistrypriv->ampdu_enable == 1)
>  			pmlmepriv->htpriv.ampdu_enable = true;
>  
> -		HT_caps_handler(padapter, (struct ndis_80211_var_ie *)pHT_caps_ie);
> +		HT_caps_handler(padapter, (struct ndis_80211_var_ie *)p_HT_caps_ie);
>  
> -		HT_info_handler(padapter, (struct ndis_80211_var_ie *)pHT_info_ie);
> +		HT_info_handler(padapter, (struct ndis_80211_var_ie *)p_HT_info_ie);
>  	}
>  
> -	pbss_network->length = get_wlan_bssid_ex_sz(
> -		(struct wlan_bssid_ex  *)pbss_network
> -	);
> +	pbss_network->length = get_wlan_bssid_ex_sz((struct wlan_bssid_ex  *)pbss_network);
>  
>  	/* issue beacon to start bss network */
>  	/* start_bss_network(padapter, (u8 *)pbss_network); */
> @@ -1149,7 +1120,9 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf,  int len)
>  	/*  update AP's sta info */
>  	update_ap_info(padapter, psta);
>  
> -	psta->state |= WIFI_AP_STATE;		/* Aries, add, fix bug of flush_cam_entry at STOP AP mode , 0724 */
> +	psta->state |= WIFI_AP_STATE; /* Aries, add, fix bug of flush_cam_entry
> +				       * at STOP AP mode , 0724
> +				       */
>  	rtw_indicate_connect(padapter);
>  
>  	pmlmepriv->cur_network.join_res = true;/* for check if already set beacon */
> @@ -1188,7 +1161,7 @@ int rtw_acl_add_sta(struct adapter *padapter, u8 *addr)
>  		paclnode = list_entry(plist, struct rtw_wlan_acl_node, list);
>  
>  		if (!memcmp(paclnode->addr, addr, ETH_ALEN)) {
> -			if (paclnode->valid == true) {
> +			if (paclnode->valid) {
>  				added = true;
>  				break;
>  			}
> @@ -1239,8 +1212,7 @@ void rtw_acl_remove_sta(struct adapter *padapter, u8 *addr)
>  	list_for_each_safe(plist, tmp, phead) {
>  		paclnode = list_entry(plist, struct rtw_wlan_acl_node, list);
>  
> -		if (
> -			!memcmp(paclnode->addr, addr, ETH_ALEN) ||
> +		if (!memcmp(paclnode->addr, addr, ETH_ALEN) ||
>  			is_broadcast_ether_addr(addr)
>  		) {
>  			if (paclnode->valid) {
> @@ -1254,7 +1226,6 @@ void rtw_acl_remove_sta(struct adapter *padapter, u8 *addr)
>  	}
>  
>  	spin_unlock_bh(&pacl_node_q->lock);
> -
>  }
>  
>  u8 rtw_ap_set_pairwise_key(struct adapter *padapter, struct sta_info *psta)
> @@ -1292,13 +1263,11 @@ u8 rtw_ap_set_pairwise_key(struct adapter *padapter, struct sta_info *psta)
>  	return res;
>  }
>  
> -static int rtw_ap_set_key(
> -	struct adapter *padapter,
> +static int rtw_ap_set_key(struct adapter *padapter, 
>  	u8 *key,
>  	u8 alg,
>  	int keyid,
> -	u8 set_tx
> -)
> +			  u8 set_tx)
>  {
>  	u8 keylen;
>  	struct cmd_obj *pcmd;
> @@ -1362,13 +1331,11 @@ int rtw_ap_set_group_key(struct adapter *padapter, u8 *key, u8 alg, int keyid)
>  	return rtw_ap_set_key(padapter, key, alg, keyid, 1);
>  }
>  
> -int rtw_ap_set_wep_key(
> -	struct adapter *padapter,
> +int rtw_ap_set_wep_key(struct adapter *padapter, 
>  	u8 *key,
>  	u8 keylen,
>  	int keyid,
> -	u8 set_tx
> -)
> +		       u8 set_tx)
>  {
>  	u8 alg;
>  
> @@ -1403,21 +1370,18 @@ static void update_bcn_erpinfo_ie(struct adapter *padapter)
>  		return;
>  
>  	/* parsing ERP_IE */
> -	p = rtw_get_ie(
> -		ie + _BEACON_IE_OFFSET_,
> +	p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, 
>  		WLAN_EID_ERP_INFO,
>  		&len,
> -		(pnetwork->ie_length - _BEACON_IE_OFFSET_)
> -	);
> +		       (pnetwork->ie_length - _BEACON_IE_OFFSET_));
>  	if (p && len > 0) {
>  		struct ndis_80211_var_ie *pIE = (struct ndis_80211_var_ie *)p;
>  
>  		if (pmlmepriv->num_sta_non_erp == 1)
>  			pIE->data[0] |= RTW_ERP_INFO_NON_ERP_PRESENT | RTW_ERP_INFO_USE_PROTECTION;
>  		else
> -			pIE->data[0] &= ~(
> -				RTW_ERP_INFO_NON_ERP_PRESENT | RTW_ERP_INFO_USE_PROTECTION
> -			);
> +			pIE->data[0] &= ~(RTW_ERP_INFO_NON_ERP_PRESENT |
> +					  RTW_ERP_INFO_USE_PROTECTION);
>  
>  		if (pmlmepriv->num_sta_no_short_preamble > 0)
>  			pIE->data[0] |= RTW_ERP_INFO_BARKER_PREAMBLE_MODE;
> @@ -1463,12 +1427,10 @@ static void update_bcn_wps_ie(struct adapter *padapter)
>  	unsigned char *ie = pnetwork->ies;
>  	u32 ielen = pnetwork->ie_length;
>  
> -	pwps_ie = rtw_get_wps_ie(
> -		ie + _FIXED_IE_LENGTH_,
> +	pwps_ie = rtw_get_wps_ie(ie + _FIXED_IE_LENGTH_,
>  		ielen - _FIXED_IE_LENGTH_,
>  		NULL,
> -		&wps_ielen
> -	);
> +				 &wps_ielen);
>  
>  	if (!pwps_ie || wps_ielen == 0)
>  		return;
> @@ -1492,7 +1454,7 @@ static void update_bcn_wps_ie(struct adapter *padapter)
>  	wps_ielen = (uint)pwps_ie_src[1];/* to get ie data len */
>  	if ((wps_offset + wps_ielen + 2 + remainder_ielen) <= MAX_IE_SZ) {
>  		memcpy(pwps_ie, pwps_ie_src, wps_ielen + 2);
> -		pwps_ie += (wps_ielen+2);
> +		pwps_ie += (wps_ielen + 2);
>  
>  		if (pbackup_remainder_ie)
>  			memcpy(pwps_ie, pbackup_remainder_ie, remainder_ielen);
> @@ -1620,8 +1582,8 @@ static int rtw_ht_operation_update(struct adapter *padapter)
>  	if (pmlmepriv->htpriv.ht_option)
>  		return 0;
>  
> -	if (!(pmlmepriv->ht_op_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT)
> -	    && pmlmepriv->num_sta_ht_no_gf) {
> +	if (!(pmlmepriv->ht_op_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT) &&
> +	    pmlmepriv->num_sta_ht_no_gf) {
>  		pmlmepriv->ht_op_mode |=
>  			IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT;
>  		op_mode_changes++;
> @@ -1653,9 +1615,8 @@ static int rtw_ht_operation_update(struct adapter *padapter)
>  	if (pmlmepriv->num_sta_no_ht ||
>  	    (pmlmepriv->ht_op_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT))
>  		new_op_mode = IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED;
> -	else if (
> -		(le16_to_cpu(phtpriv_ap->ht_cap.cap_info) & IEEE80211_HT_CAP_SUP_WIDTH)
> -		&& pmlmepriv->num_sta_ht_20mhz)
> +	else if ((le16_to_cpu(phtpriv_ap->ht_cap.cap_info) & IEEE80211_HT_CAP_SUP_WIDTH) &&
> +		 pmlmepriv->num_sta_ht_20mhz)
>  		new_op_mode = IEEE80211_HT_OP_MODE_PROTECTION_20MHZ;
>  	else if (pmlmepriv->olbc_ht)
>  		new_op_mode = IEEE80211_HT_OP_MODE_PROTECTION_NONMEMBER;
> @@ -1707,8 +1668,8 @@ void bss_cap_update_on_sta_join(struct adapter *padapter, struct sta_info *psta)
>  
>  			pmlmepriv->num_sta_no_short_preamble++;
>  
> -			if ((pmlmeext->cur_wireless_mode > WIRELESS_11B) &&
> -			    (pmlmepriv->num_sta_no_short_preamble == 1)) {
> +			if (pmlmeext->cur_wireless_mode > WIRELESS_11B &&
> +			    pmlmepriv->num_sta_no_short_preamble == 1) {
>  				beacon_updated = true;
>  				update_beacon(padapter, 0xFF, NULL, true);
>  			}
> @@ -1719,8 +1680,8 @@ void bss_cap_update_on_sta_join(struct adapter *padapter, struct sta_info *psta)
>  
>  			pmlmepriv->num_sta_no_short_preamble--;
>  
> -			if ((pmlmeext->cur_wireless_mode > WIRELESS_11B) &&
> -			    (pmlmepriv->num_sta_no_short_preamble == 0)) {
> +			if (pmlmeext->cur_wireless_mode > WIRELESS_11B &&
> +			    pmlmepriv->num_sta_no_short_preamble == 0) {
>  				beacon_updated = true;
>  				update_beacon(padapter, 0xFF, NULL, true);
>  			}
> @@ -1757,8 +1718,8 @@ void bss_cap_update_on_sta_join(struct adapter *padapter, struct sta_info *psta)
>  
>  			pmlmepriv->num_sta_no_short_slot_time++;
>  
> -			if ((pmlmeext->cur_wireless_mode > WIRELESS_11B) &&
> -			    (pmlmepriv->num_sta_no_short_slot_time == 1)) {
> +			if (pmlmeext->cur_wireless_mode > WIRELESS_11B &&
> +			    pmlmepriv->num_sta_no_short_slot_time == 1) {
>  				beacon_updated = true;
>  				update_beacon(padapter, 0xFF, NULL, true);
>  			}
> @@ -1769,8 +1730,8 @@ void bss_cap_update_on_sta_join(struct adapter *padapter, struct sta_info *psta)
>  
>  			pmlmepriv->num_sta_no_short_slot_time--;
>  
> -			if ((pmlmeext->cur_wireless_mode > WIRELESS_11B) &&
> -			    (pmlmepriv->num_sta_no_short_slot_time == 0)) {
> +			if (pmlmeext->cur_wireless_mode > WIRELESS_11B &&
> +			    pmlmepriv->num_sta_no_short_slot_time == 0) {
>  				beacon_updated = true;
>  				update_beacon(padapter, 0xFF, NULL, true);
>  			}
> @@ -1827,8 +1788,8 @@ u8 bss_cap_update_on_sta_leave(struct adapter *padapter, struct sta_info *psta)
>  	if (psta->no_short_preamble_set) {
>  		psta->no_short_preamble_set = 0;
>  		pmlmepriv->num_sta_no_short_preamble--;
> -		if (pmlmeext->cur_wireless_mode > WIRELESS_11B
> -		    && pmlmepriv->num_sta_no_short_preamble == 0){
> +		if (pmlmeext->cur_wireless_mode > WIRELESS_11B &&
> +		    pmlmepriv->num_sta_no_short_preamble == 0){
>  			beacon_updated = true;
>  			update_beacon(padapter, 0xFF, NULL, true);
>  		}
> @@ -1846,8 +1807,8 @@ u8 bss_cap_update_on_sta_leave(struct adapter *padapter, struct sta_info *psta)
>  	if (psta->no_short_slot_time_set) {
>  		psta->no_short_slot_time_set = 0;
>  		pmlmepriv->num_sta_no_short_slot_time--;
> -		if (pmlmeext->cur_wireless_mode > WIRELESS_11B
> -		    && pmlmepriv->num_sta_no_short_slot_time == 0){
> +		if (pmlmeext->cur_wireless_mode > WIRELESS_11B &&
> +		    pmlmepriv->num_sta_no_short_slot_time == 0){
>  			beacon_updated = true;
>  			update_beacon(padapter, 0xFF, NULL, true);
>  		}
> @@ -1876,12 +1837,10 @@ u8 bss_cap_update_on_sta_leave(struct adapter *padapter, struct sta_info *psta)
>  	return beacon_updated;
>  }
>  
> -u8 ap_free_sta(
> -	struct adapter *padapter,
> +u8 ap_free_sta(struct adapter *padapter, 
>  	struct sta_info *psta,
>  	bool active,
> -	u16 reason
> -)
> +	       u16 reason)
>  {
>  	u8 beacon_updated = false;
>  
> @@ -1995,6 +1954,7 @@ void ap_sta_info_defer_update(struct adapter *padapter, struct sta_info *psta)
>  		add_RATid(padapter, psta, 0);/* DM_RATR_STA_INIT */
>  	}
>  }
> +
>  /* restore hw setting from sw data structures */
>  void rtw_ap_restore_network(struct adapter *padapter)
>  {
> @@ -2009,25 +1969,22 @@ void rtw_ap_restore_network(struct adapter *padapter)
>  
>  	rtw_setopmode_cmd(padapter, Ndis802_11APMode, false);
>  
> -	set_channel_bwmode(
> -		padapter,
> +	set_channel_bwmode(padapter, 
> +		
>  		pmlmeext->cur_channel,
>  		pmlmeext->cur_ch_offset,
> -		pmlmeext->cur_bwmode
> -	);
> +			   pmlmeext->cur_bwmode);
>  
>  	start_bss_network(padapter);
>  
>  	if ((padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_) ||
>  	    (padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)) {
>  		/* restore group key, WEP keys is restored in ips_leave() */
> -		rtw_set_key(
> -			padapter,
> +		rtw_set_key(padapter, 
>  			psecuritypriv,
>  			psecuritypriv->dot118021XGrpKeyid,
>  			0,
> -			false
> -		);
> +			    false);
>  	}
>  
>  	spin_lock_bh(&pstapriv->asoc_list_lock);
> @@ -2128,11 +2085,9 @@ void stop_ap_mode(struct adapter *padapter)
>  	pmlmeext->bstart_bss = false;
>  
>  	/* reset and init security priv , this can refine with rtw_reset_securitypriv */
> -	memset(
> -		(unsigned char *)&padapter->securitypriv,
> -		0,
> -		sizeof(struct security_priv)
> -	);
> +	memset((unsigned char *)&padapter->securitypriv,
> +	       0, 
> +	       sizeof(struct security_priv));
>  	padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen;
>  	padapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled;
>  
> diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
> index ef2d92b5588a..61c00e6c0078 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
> @@ -175,7 +175,8 @@ int rtw_init_cmd_priv(struct	cmd_priv *pcmdpriv)
>  	if (!pcmdpriv->cmd_allocated_buf)
>  		return -ENOMEM;
>  
> -	pcmdpriv->cmd_buf = pcmdpriv->cmd_allocated_buf  +  CMDBUFF_ALIGN_SZ - ((SIZE_PTR)(pcmdpriv->cmd_allocated_buf) & (CMDBUFF_ALIGN_SZ-1));
> +	pcmdpriv->cmd_buf = pcmdpriv->cmd_allocated_buf  +  CMDBUFF_ALIGN_SZ -
> +		((SIZE_PTR)(pcmdpriv->cmd_allocated_buf) & (CMDBUFF_ALIGN_SZ - 1));
>  
>  	pcmdpriv->rsp_allocated_buf = rtw_zmalloc(MAX_RSPSZ + 4);
>  
> @@ -184,7 +185,8 @@ int rtw_init_cmd_priv(struct	cmd_priv *pcmdpriv)
>  		return -ENOMEM;
>  	}
>  
> -	pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf  +  4 - ((SIZE_PTR)(pcmdpriv->rsp_allocated_buf) & 3);
> +	pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf  +  4 -
> +			((SIZE_PTR)(pcmdpriv->rsp_allocated_buf) & 3);
>  
>  	pcmdpriv->cmd_issued_cnt = 0;
>  	pcmdpriv->cmd_done_cnt = 0;
> @@ -204,7 +206,7 @@ int rtw_init_evt_priv(struct evt_priv *pevtpriv)
>  
>  	_init_workitem(&pevtpriv->c2h_wk, c2h_wk_callback, NULL);
>  	pevtpriv->c2h_wk_alive = false;
> -	pevtpriv->c2h_queue = rtw_cbuf_alloc(C2H_QUEUE_MAX_LEN+1);
> +	pevtpriv->c2h_queue = rtw_cbuf_alloc(C2H_QUEUE_MAX_LEN + 1);
>  	if (!pevtpriv->c2h_queue)
>  		return -ENOMEM;
>  
> @@ -305,7 +307,7 @@ int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
>  		bAllow = true;
>  
>  	if ((!pcmdpriv->padapter->hw_init_completed && !bAllow) ||
> -		!atomic_read(&pcmdpriv->cmdthd_running))	/* com_thread not running */
> +	    !atomic_read(&pcmdpriv->cmdthd_running)) /* com_thread not running */
>  		return _FAIL;
>  
>  	return _SUCCESS;
> @@ -362,9 +364,8 @@ void rtw_free_cmd_obj(struct cmd_obj *pcmd)
>  
>  void rtw_stop_cmd_thread(struct adapter *adapter)
>  {
> -	if (adapter->cmdThread &&
> -		atomic_read(&adapter->cmdpriv.cmdthd_running) &&
> -		adapter->cmdpriv.stop_req == 0) {
> +	if (adapter->cmdThread && atomic_read(&adapter->cmdpriv.cmdthd_running) &&
> +	    adapter->cmdpriv.stop_req == 0) {
>  		adapter->cmdpriv.stop_req = 1;
>  		complete(&adapter->cmdpriv.cmd_queue_comp);
>  		wait_for_completion(&adapter->cmdpriv.terminate_cmdthread_comp);
> @@ -392,8 +393,8 @@ int rtw_cmd_thread(void *context)
>  
>  	while (1) {
>  		if (wait_for_completion_interruptible(&pcmdpriv->cmd_queue_comp)) {
> -			netdev_dbg(padapter->pnetdev,
> -				   FUNC_ADPT_FMT " wait_for_completion_interruptible(&pcmdpriv->cmd_queue_comp) return != 0, break\n",
> +			netdev_dbg(padapter->pnetdev, FUNC_ADPT_FMT
> +				" wait_for_completion_interruptible(&pcmdpriv->cmd_queue_comp) return != 0, break\n",
>  				   FUNC_ADPT_ARG(padapter));
>  			break;
>  		}
> @@ -484,7 +485,9 @@ int rtw_cmd_thread(void *context)
>  				rtw_free_cmd_obj(pcmd);
>  			} else {
>  				/* todo: !!! fill rsp_buf to pcmd->rsp if (pcmd->rsp!= NULL) */
> -				pcmd_callback(pcmd->padapter, pcmd);/* need consider that free cmd_obj in rtw_cmd_callback */
> +				pcmd_callback(pcmd->padapter, pcmd); /* need consider that free
> +								      * cmd_obj in rtw_cmd_callback
> +								      */
>  			}
>  		} else {
>  			rtw_free_cmd_obj(pcmd);
> @@ -523,7 +526,7 @@ int rtw_cmd_thread(void *context)
>   */
>  
>  u8 rtw_sitesurvey_cmd(struct adapter  *padapter, struct ndis_802_11_ssid *ssid, int ssid_num,
> -	struct rtw_ieee80211_channel *ch, int ch_num)
> +		      struct rtw_ieee80211_channel *ch, int ch_num)
>  {
>  	u8 res = _FAIL;
>  	struct cmd_obj *ph2c;
> @@ -557,7 +560,8 @@ u8 rtw_sitesurvey_cmd(struct adapter  *padapter, struct ndis_802_11_ssid *ssid,
>  
>  		for (i = 0; i < ssid_num && i < RTW_SSID_SCAN_AMOUNT; i++) {
>  			if (ssid[i].ssid_length) {
> -				memcpy(&psurveyPara->ssid[i], &ssid[i], sizeof(struct ndis_802_11_ssid));
> +				memcpy(&psurveyPara->ssid[i], &ssid[i],
> +				       sizeof(struct ndis_802_11_ssid));
>  				psurveyPara->ssid_num++;
>  			}
>  		}
> @@ -569,7 +573,8 @@ u8 rtw_sitesurvey_cmd(struct adapter  *padapter, struct ndis_802_11_ssid *ssid,
>  
>  		for (i = 0; i < ch_num && i < RTW_CHANNEL_SCAN_AMOUNT; i++) {
>  			if (ch[i].hw_value && !(ch[i].flags & RTW_IEEE80211_CHAN_DISABLED)) {
> -				memcpy(&psurveyPara->ch[i], &ch[i], sizeof(struct rtw_ieee80211_channel));
> +				memcpy(&psurveyPara->ch[i], &ch[i],
> +				       sizeof(struct rtw_ieee80211_channel));
>  				psurveyPara->ch_num++;
>  			}
>  		}
> @@ -681,7 +686,8 @@ u8 rtw_joinbss_cmd(struct adapter  *padapter, struct wlan_network *pnetwork)
>  	struct security_priv *psecuritypriv = &padapter->securitypriv;
>  	struct registry_priv *pregistrypriv = &padapter->registrypriv;
>  	struct ht_priv *phtpriv = &pmlmepriv->htpriv;
> -	enum ndis_802_11_network_infrastructure ndis_network_mode = pnetwork->network.infrastructure_mode;
> +	enum ndis_802_11_network_infrastructure ndis_network_mode =
> +		pnetwork->network.infrastructure_mode;
>  	struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
>  	struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
>  	u32 tmp_len;
> @@ -696,7 +702,7 @@ u8 rtw_joinbss_cmd(struct adapter  *padapter, struct wlan_network *pnetwork)
>  	t_len = sizeof(struct wlan_bssid_ex);
>  
>  	/* for hidden ap to set fw_state here */
> -	if (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) != true) {
> +	if (check_fwstate(pmlmepriv, WIFI_STATION_STATE | WIFI_ADHOC_STATE) != true) {
>  		switch (ndis_network_mode) {
>  		case Ndis802_11IBSS:
>  			set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
> @@ -721,10 +727,11 @@ u8 rtw_joinbss_cmd(struct adapter  *padapter, struct wlan_network *pnetwork)
>  
>  	psecuritypriv->authenticator_ie[0] = (unsigned char)psecnetwork->ie_length;
>  
> -	if ((psecnetwork->ie_length-12) < (256-1))
> -		memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->ies[12], psecnetwork->ie_length-12);
> +	if ((psecnetwork->ie_length - 12) < (256 - 1))
> +		memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->ies[12],
> +		       psecnetwork->ie_length - 12);
>  	else
> -		memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->ies[12], (256-1));
> +		memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->ies[12], (256 - 1));
>  
>  	psecnetwork->ie_length = 0;
>  	/*  Added by Albert 2009/02/18 */
> @@ -735,12 +742,19 @@ u8 rtw_joinbss_cmd(struct adapter  *padapter, struct wlan_network *pnetwork)
>  	if (!pmlmepriv->assoc_by_bssid)
>  		memcpy(&pmlmepriv->assoc_bssid[0], &pnetwork->network.mac_address[0], ETH_ALEN);
>  
> -	psecnetwork->ie_length = rtw_restruct_sec_ie(padapter, &pnetwork->network.ies[0], &psecnetwork->ies[0], pnetwork->network.ie_length);
> +	psecnetwork->ie_length = rtw_restruct_sec_ie(padapter,
> +						     &pnetwork->network.ies[0],
> +						     &psecnetwork->ies[0],
> +						     pnetwork->network.ie_length);
>  
>  	pqospriv->qos_option = 0;
>  
>  	if (pregistrypriv->wmm_enable) {
> -		tmp_len = rtw_restruct_wmm_ie(padapter, &pnetwork->network.ies[0], &psecnetwork->ies[0], pnetwork->network.ie_length, psecnetwork->ie_length);
> +		tmp_len = rtw_restruct_wmm_ie(padapter,
> +					      &pnetwork->network.ies[0],
> +					      &psecnetwork->ies[0],
> +					      pnetwork->network.ie_length,
> +					      psecnetwork->ie_length);
>  
>  		if (psecnetwork->ie_length != tmp_len) {
>  			psecnetwork->ie_length = tmp_len;
> @@ -751,28 +765,39 @@ u8 rtw_joinbss_cmd(struct adapter  *padapter, struct wlan_network *pnetwork)
>  	}
>  
>  	phtpriv->ht_option = false;
> -	ptmp = rtw_get_ie(&pnetwork->network.ies[12], WLAN_EID_HT_CAPABILITY, &tmp_len, pnetwork->network.ie_length-12);
> +	ptmp = rtw_get_ie(&pnetwork->network.ies[12],
> +			  WLAN_EID_HT_CAPABILITY,
> +			  &tmp_len,
> +			  pnetwork->network.ie_length - 12);
>  	if (pregistrypriv->ht_enable && ptmp && tmp_len > 0) {
> -		/* Added by Albert 2010/06/23 */
> -		/* For the WEP mode, we will use the bg mode to do the connection to avoid some IOT issue. */
> -		/* Especially for Realtek 8192u SoftAP. */
> +		/* Added by Albert 2010/06/23
> +		 * For the WEP mode, we will use the bg mode to
> +		 * do the connection to avoid some IOT issue.
> +		 * Especially for Realtek 8192u SoftAP.
> +		 */
>  		if ((padapter->securitypriv.dot11PrivacyAlgrthm != _WEP40_) &&
> -			(padapter->securitypriv.dot11PrivacyAlgrthm != _WEP104_) &&
> -			(padapter->securitypriv.dot11PrivacyAlgrthm != _TKIP_)) {
> +		    (padapter->securitypriv.dot11PrivacyAlgrthm != _WEP104_) &&
> +		    (padapter->securitypriv.dot11PrivacyAlgrthm != _TKIP_)) {
>  			rtw_ht_use_default_setting(padapter);
>  
> -			rtw_build_wmm_ie_ht(padapter, &psecnetwork->ies[12], &psecnetwork->ie_length);
> +			rtw_build_wmm_ie_ht(padapter,
> +					    &psecnetwork->ies[12],
> +					    &psecnetwork->ie_length);
>  
>  			/* rtw_restructure_ht_ie */
> -			rtw_restructure_ht_ie(padapter, &pnetwork->network.ies[12], &psecnetwork->ies[0],
> -									pnetwork->network.ie_length-12, &psecnetwork->ie_length,
> -									pnetwork->network.configuration.ds_config);
> +			rtw_restructure_ht_ie(padapter,
> +					      &pnetwork->network.ies[12],
> +					      &psecnetwork->ies[0],
> +					      pnetwork->network.ie_length - 12,
> +					      &psecnetwork->ie_length,
> +					      pnetwork->network.configuration.ds_config);
>  		}
>  	}
>  
>  	rtw_append_exented_cap(padapter, &psecnetwork->ies[0], &psecnetwork->ie_length);
>  
> -	pmlmeinfo->assoc_AP_vendor = check_assoc_AP(pnetwork->network.ies, pnetwork->network.ie_length);
> +	pmlmeinfo->assoc_AP_vendor = check_assoc_AP(pnetwork->network.ies,
> +						    pnetwork->network.ie_length);
>  
>  	pcmd->cmdsz = get_wlan_bssid_ex_sz(psecnetwork);/* get cmdsz before endian conversion */
>  
> @@ -788,7 +813,9 @@ u8 rtw_joinbss_cmd(struct adapter  *padapter, struct wlan_network *pnetwork)
>  	return res;
>  }
>  
> -u8 rtw_disassoc_cmd(struct adapter *padapter, u32 deauth_timeout_ms, bool enqueue) /* for sta_mode */
> +u8 rtw_disassoc_cmd(struct adapter *padapter,
> +		    u32 deauth_timeout_ms,
> +		    bool enqueue) /* for sta_mode */
>  {
>  	struct cmd_obj *cmdobj = NULL;
>  	struct disconnect_parm *param = NULL;
> @@ -824,7 +851,9 @@ u8 rtw_disassoc_cmd(struct adapter *padapter, u32 deauth_timeout_ms, bool enqueu
>  	return res;
>  }
>  
> -u8 rtw_setopmode_cmd(struct adapter  *padapter, enum ndis_802_11_network_infrastructure networktype, bool enqueue)
> +u8 rtw_setopmode_cmd(struct adapter  *padapter,
> +		     enum ndis_802_11_network_infrastructure networktype,
> +		     bool enqueue)
>  {
>  	struct	cmd_obj *ph2c;
>  	struct	setopmode_parm *psetop;
> @@ -884,7 +913,9 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, struct sta_info *sta, u8 unicast_
>  	if (unicast_key)
>  		memcpy(&psetstakey_para->key, &sta->dot118021x_UncstKey, 16);
>  	else
> -		memcpy(&psetstakey_para->key, &psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey, 16);
> +		memcpy(&psetstakey_para->key,
> +		       &psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey,
> +		       16);
>  
>  	/* jeff: set this because at least sw key is ready */
>  	padapter->securitypriv.busetkipkey = true;
> @@ -1002,6 +1033,7 @@ u8 rtw_addbareq_cmd(struct adapter *padapter, u8 tid, u8 *addr)
>  exit:
>  	return res;
>  }
> +
>  /* add for CONFIG_IEEE80211W, none 11w can use it */
>  u8 rtw_reset_securitypriv_cmd(struct adapter *padapter)
>  {
> @@ -1117,13 +1149,17 @@ static void collect_traffic_statistics(struct adapter *padapter)
>  	pdvobjpriv->traffic_stat.rx_drop = padapter->recvpriv.rx_drop;
>  
>  	/*  Calculate throughput in last interval */
> -	pdvobjpriv->traffic_stat.cur_tx_bytes = pdvobjpriv->traffic_stat.tx_bytes - pdvobjpriv->traffic_stat.last_tx_bytes;
> -	pdvobjpriv->traffic_stat.cur_rx_bytes = pdvobjpriv->traffic_stat.rx_bytes - pdvobjpriv->traffic_stat.last_rx_bytes;
> +	pdvobjpriv->traffic_stat.cur_tx_bytes = pdvobjpriv->traffic_stat.tx_bytes -
> +						pdvobjpriv->traffic_stat.last_tx_bytes;
> +	pdvobjpriv->traffic_stat.cur_rx_bytes = pdvobjpriv->traffic_stat.rx_bytes -
> +						pdvobjpriv->traffic_stat.last_rx_bytes;
>  	pdvobjpriv->traffic_stat.last_tx_bytes = pdvobjpriv->traffic_stat.tx_bytes;
>  	pdvobjpriv->traffic_stat.last_rx_bytes = pdvobjpriv->traffic_stat.rx_bytes;
>  
> -	pdvobjpriv->traffic_stat.cur_tx_tp = (u32)(pdvobjpriv->traffic_stat.cur_tx_bytes * 8/2/1024/1024);
> -	pdvobjpriv->traffic_stat.cur_rx_tp = (u32)(pdvobjpriv->traffic_stat.cur_rx_bytes * 8/2/1024/1024);
> +	pdvobjpriv->traffic_stat.cur_tx_tp = (u32)(pdvobjpriv->traffic_stat.cur_tx_bytes *
> +						   8 / 2 / 1024 / 1024);
> +	pdvobjpriv->traffic_stat.cur_rx_tp = (u32)(pdvobjpriv->traffic_stat.cur_rx_bytes *
> +						   8 / 2 / 1024 / 1024);
>  }
>  
>  u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer)
> @@ -1148,10 +1184,11 @@ u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer)
>  			BusyThreshold = BusyThresholdLow;
>  
>  		if (pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > BusyThreshold ||
> -			pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > BusyThreshold) {
> +		    pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > BusyThreshold) {
>  			bBusyTraffic = true;
>  
> -			if (pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > pmlmepriv->LinkDetectInfo.NumTxOkInPeriod)
> +			if (pmlmepriv->LinkDetectInfo.NumRxOkInPeriod >
> +			    pmlmepriv->LinkDetectInfo.NumTxOkInPeriod)
>  				bRxBusyTraffic = true;
>  			else
>  				bTxBusyTraffic = true;
> @@ -1159,18 +1196,20 @@ u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer)
>  
>  		/*  Higher Tx/Rx data. */
>  		if (pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 4000 ||
> -			pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 4000) {
> +		    pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 4000) {
>  			bHigherBusyTraffic = true;
>  
> -			if (pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > pmlmepriv->LinkDetectInfo.NumTxOkInPeriod)
> +			if (pmlmepriv->LinkDetectInfo.NumRxOkInPeriod >
> +			    pmlmepriv->LinkDetectInfo.NumTxOkInPeriod)
>  				bHigherBusyRxTraffic = true;
>  			else
>  				bHigherBusyTxTraffic = true;
>  		}
>  
>  		/*  check traffic for  powersaving. */
> -		if (((pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod + pmlmepriv->LinkDetectInfo.NumTxOkInPeriod) > 8) ||
> -			(pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod > 2)) {
> +		if (((pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod +
> +		      pmlmepriv->LinkDetectInfo.NumTxOkInPeriod) > 8) ||
> +		     (pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod > 2)) {
>  			bEnterPS = false;
>  
>  			if (bBusyTraffic) {
> @@ -1179,7 +1218,7 @@ u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer)
>  
>  				pmlmepriv->LinkDetectInfo.TrafficTransitionCount++;
>  
> -				if (pmlmepriv->LinkDetectInfo.TrafficTransitionCount > 30/*TrafficTransitionLevel*/)
> +				if (pmlmepriv->LinkDetectInfo.TrafficTransitionCount > 30 /*TrafficTransitionLevel*/)
>  					pmlmepriv->LinkDetectInfo.TrafficTransitionCount = 30;
>  			}
>  		} else {
> @@ -1224,7 +1263,6 @@ u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer)
>  	pmlmepriv->LinkDetectInfo.bHigherBusyTxTraffic = bHigherBusyTxTraffic;
>  
>  	return bEnterPS;
> -
>  }
>  
>  static void dynamic_chk_wk_hdl(struct adapter *padapter)
> @@ -1264,7 +1302,7 @@ void lps_ctrl_wk_hdl(struct adapter *padapter, u8 lps_ctrl_type)
>  	u8 mstatus;
>  
>  	if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) ||
> -		check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
> +	    check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
>  		return;
>  	}
>  
> @@ -1444,9 +1482,7 @@ u8 rtw_dm_ra_mask_wk_cmd(struct adapter *padapter, u8 *psta)
>  	res = rtw_enqueue_cmd(pcmdpriv, ph2c);
>  
>  exit:
> -
>  	return res;
> -
>  }
>  
>  u8 rtw_ps_cmd(struct adapter *padapter)
> @@ -1516,9 +1552,7 @@ static void rtw_chk_hi_queue_hdl(struct adapter *padapter)
>  		} else {/* re check again */
>  			rtw_chk_hi_queue_cmd(padapter);
>  		}
> -
>  	}
> -
>  }
>  
>  u8 rtw_chk_hi_queue_cmd(struct adapter *padapter)
> @@ -1598,9 +1632,9 @@ static void rtw_btinfo_hdl(struct adapter *adapter, u8 *buf, u16 buf_len)
>  
>  	cmd_idx = info->cid;
>  
> -	if (info->len > buf_len-2) {
> +	if (info->len > buf_len - 2) {
>  		rtw_warn_on(1);
> -		len = buf_len-2;
> +		len = buf_len - 2;
>  	} else {
>  		len = info->len;
>  	}
> @@ -1610,7 +1644,7 @@ static void rtw_btinfo_hdl(struct adapter *adapter, u8 *buf, u16 buf_len)
>  		buf[1] = 0;
>  	else if (cmd_idx == BTINFO_BT_AUTO_RPT)
>  		buf[1] = 2;
> -	hal_btcoex_BtInfoNotify(adapter, len+1, &buf[1]);
> +	hal_btcoex_BtInfoNotify(adapter, len + 1, &buf[1]);
>  }
>  
>  u8 rtw_c2h_packet_wk_cmd(struct adapter *padapter, u8 *pbuf, u16 length)
> @@ -1670,7 +1704,7 @@ u8 rtw_c2h_wk_cmd(struct adapter *padapter, u8 *c2h_evt)
>  
>  	pdrvextra_cmd_parm->ec_id = C2H_WK_CID;
>  	pdrvextra_cmd_parm->type = 0;
> -	pdrvextra_cmd_parm->size =  c2h_evt?16:0;
> +	pdrvextra_cmd_parm->size =  c2h_evt ? 16 : 0;
>  	pdrvextra_cmd_parm->pbuf = c2h_evt;
>  
>  	init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
> @@ -1739,7 +1773,9 @@ u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf)
>  	pdrvextra_cmd = (struct drvextra_cmd_parm *)pbuf;
>  
>  	switch (pdrvextra_cmd->ec_id) {
> -	case DYNAMIC_CHK_WK_CID:/* only  primary padapter go to this cmd, but execute dynamic_chk_wk_hdl() for two interfaces */
> +	case DYNAMIC_CHK_WK_CID: /* only  primary padapter go to this cmd,
> +				  * but execute dynamic_chk_wk_hdl() for two interfaces
> +				  */
>  		dynamic_chk_wk_hdl(padapter);
>  		break;
>  	case POWER_SAVING_CTRL_WK_CID:
> @@ -1765,7 +1801,10 @@ u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf)
>  		rtw_free_assoc_resources(padapter, 1);
>  		break;
>  	case C2H_WK_CID:
> -		rtw_hal_set_hwreg_with_buf(padapter, HW_VAR_C2H_HANDLE, pdrvextra_cmd->pbuf, pdrvextra_cmd->size);
> +		rtw_hal_set_hwreg_with_buf(padapter,
> +					   HW_VAR_C2H_HANDLE,
> +					   pdrvextra_cmd->pbuf,
> +					   pdrvextra_cmd->size);
>  		break;
>  	case DM_RA_MSK_WK_CID:
>  		rtw_dm_ra_mask_hdl(padapter, (struct sta_info *)pdrvextra_cmd->pbuf);
> @@ -1876,12 +1915,12 @@ void rtw_createbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd)
>  		_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
>  
>  		spin_unlock_bh(&pmlmepriv->scanned_queue.lock);
> -		/*  we will set _FW_LINKED when there is one more sat to join us (rtw_stassoc_event_callback) */
> -
> +		/* we will set _FW_LINKED when there is one more
> +		 * sat to join us (rtw_stassoc_event_callback)
> +		 */
>  	}
>  
>  createbss_cmd_fail:
> -
>  	spin_unlock_bh(&pmlmepriv->lock);
>  exit:
>  	rtw_free_cmd_obj(pcmd);
> -- 
> 2.43.0
> 
> 

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- Your patch did many different things all at once, making it difficult
  to review.  All Linux kernel patches need to only do one thing at a
  time.  If you need to do multiple things (such as clean up all coding
  style issues in a file/driver), do it in a sequence of patches, each
  one doing only one thing.  This will make it easier to review the
  patches to ensure that they are correct, and to help alleviate any
  merge issues that larger patches can cause.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ