staging: rtl8723bs: comment and style cleanups
cover staging: rtl8723bs: comment and style cleanups
Hi,
This small series does some minor cleanups in rtw_mlme.c for the rtl8723bs staging driver:
- Patch 1 removes trailing whitespace in a multi-line comment.
- Patch 2 fixes spacing around operators as reported by checkpatch.pl.
These are purely code-style changes and should be NFC.
Best
Vivek
Vivek BalachandharTN (2):
staging: rtl8723bs: remove trailing whitespace in comment
staging: rtl8723bs: fix spacing around operators
drivers/staging/rtl8723bs/core/rtw_mlme.c | 74 +++++++++++------------ 1 file changed, 37 insertions(+), 37 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/2 staging: rtl8723bs: remove trailing whitespace in comment
A comment line in rtw_mlme.c contained trailing whitespace. This cleanup removes the unnecessary whitespace and aligns the file with kernel coding-style expectations. No functional changes.
--- drivers/staging/rtl8723bs/core/rtw_mlme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723bs/core/rtw_mlme.c +1 -1
@@ -2024,7 +2024,7 @@ int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_return ielength; } -/* Ported from 8185: IsInPreAuthKeyList(). +/* Ported from 8185: IsInPreAuthKeyList(). * (Renamed from SecIsInPreAuthKeyList(), 2006-10-13.) * Added by Annie, 2006-05-07. *
Signature · 1 line
2.34.1
PATCH 2/2 staging: rtl8723bs: fix spacing around operators
In reply to Vivek BalachandharTNFix several instances where operators lacked spaces around them. This improves readability and brings the driver closer to kernel coding-style guidelines. No functional change.
--- drivers/staging/rtl8723bs/core/rtw_mlme.c | 72 +++++++++++------------ 1 file changed, 36 insertions(+), 36 deletions(-)
drivers/staging/rtl8723bs/core/rtw_mlme.c +36 -36
@@ -283,8 +283,8 @@ void rtw_generate_random_ibss(u8 *pibss) pibss[1 ] =0x11 ; pibss[2 ] =0x87 ; pibss[3 ] = (u8)(curtime &0xff ) ;/* p[0]; */ - pibss[4 ] = (u8)((curtime>>8 ) &0xff ) ;/* p[1]; */ - pibss[5 ] = (u8)((curtime>>16 ) &0xff ) ;/* p[2]; */ + pibss[4 ] = (u8)((curtime >>8 ) &0xff ) ;/* p[1]; */ + pibss[5 ] = (u8)((curtime >>16 ) &0xff ) ;/* p[2]; */ }u8 *rtw_get_capability_from_ie (u8 *ie)
@@ -433,14 +433,14 @@ void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src, sq_final = padapter->recvpriv.signal_qual;/* the rssi value here is undecorated, and will be used for antenna diversity */ if (sq_smp !=101 )/* from the right channel */ - rssi_final = (src->rssi+dst->rssi*4 )/5 ; + rssi_final = (src->rssi + dst->rssi *4 ) /5 ;else rssi_final = rssi_ori; }else {if (sq_smp !=101 ) {/* from the right channel */ - ss_final = ((u32)(src->phy_info.signal_strength)+(u32)(dst->phy_info.signal_strength)*4 )/5 ; - sq_final = ((u32)(src->phy_info.signal_quality)+(u32)(dst->phy_info.signal_quality)*4 )/5 ; - rssi_final = (src->rssi+dst->rssi*4 )/5 ; + ss_final = ((u32)(src->phy_info.signal_strength) + (u32)(dst->phy_info.signal_strength) *4 ) /5 ; + sq_final = ((u32)(src->phy_info.signal_quality) + (u32)(dst->phy_info.signal_quality) *4 ) /5 ; + rssi_final = (src->rssi + dst->rssi *4 ) /5 ; }else {/* bss info not receiving from the right channel, use the original RX signal infos */ ss_final = dst->phy_info.signal_strength;
@@ -609,7 +609,7 @@ int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetwor privacy = pnetwork->network.privacy;if (check_fwstate (pmlmepriv,WIFI_UNDER_WPS )) { -if (rtw_get_wps_ie (pnetwork->network.ies+_FIXED_IE_LENGTH_, pnetwork->network.ie_length-_FIXED_IE_LENGTH_,NULL , &wps_ielen)) +if (rtw_get_wps_ie (pnetwork->network.ies + _FIXED_IE_LENGTH_, pnetwork->network.ie_length - _FIXED_IE_LENGTH_,NULL , &wps_ielen))return true;else return false;
@@ -853,14 +853,14 @@ void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue)struct dvobj_priv *psdpriv = adapter->dvobj;struct debug_priv *pdbgpriv = &psdpriv->drv_dbg; -if (check_fwstate (pmlmepriv,WIFI_STATION_STATE |WIFI_AP_STATE )) { +if (check_fwstate (pmlmepriv,WIFI_STATION_STATE |WIFI_AP_STATE )) {struct sta_info *psta; psta =rtw_get_stainfo (&adapter->stapriv, tgt_network->network.mac_address);rtw_free_stainfo (adapter, psta); } -if (check_fwstate (pmlmepriv,WIFI_ADHOC_STATE |WIFI_ADHOC_MASTER_STATE |WIFI_AP_STATE )) { +if (check_fwstate (pmlmepriv,WIFI_ADHOC_STATE |WIFI_ADHOC_MASTER_STATE |WIFI_AP_STATE )) {struct sta_info *psta;rtw_free_all_stainfo (adapter);
@@ -915,7 +915,7 @@ void rtw_indicate_disconnect(struct adapter *padapter) {struct mlme_priv *pmlmepriv = &padapter->mlmepriv; -_clr_fwstate_ (pmlmepriv, _FW_UNDER_LINKING|WIFI_UNDER_WPS ); +_clr_fwstate_ (pmlmepriv, _FW_UNDER_LINKING |WIFI_UNDER_WPS );if (rtw_to_roam (padapter) >0 )_clr_fwstate_ (pmlmepriv, _FW_LINKED);
@@ -946,7 +946,7 @@ inline void rtw_indicate_scan_done(struct adapter *padapter, bool aborted)if ((!adapter_to_pwrctl (padapter)->bInSuspend) && (!check_fwstate (&padapter->mlmepriv, -WIFI_ASOC_STATE |WIFI_UNDER_LINKING ))) { +WIFI_ASOC_STATE |WIFI_UNDER_LINKING ))) {rtw_set_ips_deny (padapter,0 );_set_timer (&padapter->mlmepriv.dynamic_chk_timer,1 ); }
@@ -1084,8 +1084,8 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_netswitch (pnetwork->network.infrastructure_mode) {case Ndis802_11Infrastructure: -if (pmlmepriv->fw_state&WIFI_UNDER_WPS ) - pmlmepriv->fw_state =WIFI_STATION_STATE |WIFI_UNDER_WPS ; +if (pmlmepriv->fw_state &WIFI_UNDER_WPS ) + pmlmepriv->fw_state =WIFI_STATION_STATE |WIFI_UNDER_WPS ;else pmlmepriv->fw_state =WIFI_STATION_STATE ;
@@ -1315,7 +1315,7 @@ void rtw_sta_media_status_rpt(struct adapter *adapter, struct sta_info *psta, u3if (!psta)return ; - media_status_rpt = (u16)((psta->mac_id<<8 )|mstatus);/* MACID|OPMODE:1 connect */ + media_status_rpt = (u16)((psta->mac_id <<8 ) | mstatus);/* MACID|OPMODE:1 connect */ rtw_hal_set_hwreg (adapter,HW_VAR_H2C_MEDIA_STATUS_RPT , (u8 *)&media_status_rpt); }
@@ -1433,13 +1433,13 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)if (mac_id >=0 ) {u16 media_status; - media_status = (mac_id<<8 )|0 ;/* MACID|OPMODE:0 means disconnect */ + media_status = (mac_id <<8 ) |0 ;/* MACID|OPMODE:0 means disconnect */ /* for STA, AP, ADHOC mode, report disconnect stauts to FW */ rtw_hal_set_hwreg (adapter,HW_VAR_H2C_MEDIA_STATUS_RPT , (u8 *)&media_status); }/* if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) */ -if ((pmlmeinfo->state&0x03 ) ==WIFI_FW_AP_STATE ) +if ((pmlmeinfo->state &0x03 ) ==WIFI_FW_AP_STATE )return ;mlmeext_sta_del_event_callback (adapter);
@@ -1613,7 +1613,7 @@ void rtw_mlme_reset_auto_scan_int(struct adapter *adapter)if (pmlmeinfo->VHT_enable)/* disable auto scan when connect to 11AC AP */ mlme->auto_scan_int_ms =0 ;else if (adapter->registrypriv.wifi_spec &&is_client_associated_to_ap (adapter) == true) - mlme->auto_scan_int_ms =60 *1000 ; + mlme->auto_scan_int_ms =60 *1000 ;else if (rtw_chk_roam_flags (adapter,RTW_ROAM_ACTIVE )) {if (check_fwstate (mlme,WIFI_STATION_STATE ) &&check_fwstate (mlme, _FW_LINKED)) mlme->auto_scan_int_ms = mlme->roam_scan_int_ms;
@@ -2006,7 +2006,7 @@ int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_while (i < in_len) { ielength = initial_out_len; -if (in_ie[i] ==0xDD && in_ie[i+2 ] ==0x00 && in_ie[i+3 ] ==0x50 && in_ie[i+4 ] ==0xF2 && in_ie[i+5 ] ==0x02 && i+5 < in_len) {/* WMM element ID and OUI */ +if (in_ie[i] ==0xDD && in_ie[i +2 ] ==0x00 && in_ie[i +3 ] ==0x50 && in_ie[i +4 ] ==0xF2 && in_ie[i +5 ] ==0x02 && i +5 < in_len) {/* WMM element ID and OUI */ for (j = i; j < i +9 ; j++) { out_ie[ielength] = in_ie[j]; ielength++;
@@ -2018,7 +2018,7 @@ int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_break ; } - i += (in_ie[i+1 ]+2 );/* to the next IE element */ + i += (in_ie[i +1 ] +2 );/* to the next IE element */ }return ielength;
@@ -2124,13 +2124,13 @@ signed int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, u authmode =WLAN_EID_RSN ;if (check_fwstate (pmlmepriv,WIFI_UNDER_WPS )) { -memcpy (out_ie+ielength, psecuritypriv->wps_ie, psecuritypriv->wps_ie_len); +memcpy (out_ie + ielength, psecuritypriv->wps_ie, psecuritypriv->wps_ie_len); ielength += psecuritypriv->wps_ie_len; }else if ((authmode ==WLAN_EID_VENDOR_SPECIFIC ) || (authmode ==WLAN_EID_RSN )) {/* copy RSN or SSN */ -memcpy (&out_ie[ielength], &psecuritypriv->supplicant_ie[0 ], psecuritypriv->supplicant_ie[1 ]+2 ); - ielength += psecuritypriv->supplicant_ie[1 ]+2 ; +memcpy (&out_ie[ielength], &psecuritypriv->supplicant_ie[0 ], psecuritypriv->supplicant_ie[1 ] +2 ); + ielength += psecuritypriv->supplicant_ie[1 ] +2 ;rtw_report_sec_ie (adapter, authmode, psecuritypriv->supplicant_ie); }
@@ -2298,7 +2298,7 @@ void rtw_build_wmm_ie_ht(struct adapter *padapter, u8 *out_ie, uint *pout_len)if (padapter->mlmepriv.qospriv.qos_option ==0 ) { out_len = *pout_len; -rtw_set_ie (out_ie+out_len,WLAN_EID_VENDOR_SPECIFIC , +rtw_set_ie (out_ie + out_len,WLAN_EID_VENDOR_SPECIFIC , _WMM_IE_Length_,WMM_IE , pout_len); padapter->mlmepriv.qospriv.qos_option =1 ;
@@ -2342,7 +2342,7 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_ }else { p =rtw_get_ie (in_ie,WLAN_EID_HT_OPERATION , &ielen, in_len);if (p && (ielen ==sizeof (struct ieee80211_ht_addt_info ))) { -struct HT_info_element *pht_info = (struct HT_info_element *)(p+2 ); +struct HT_info_element *pht_info = (struct HT_info_element *)(p +2 );if (pht_info->infos[0 ] &BIT (2 )) {switch (pht_info->infos[0 ] &0x3 ) {
@@ -2405,14 +2405,14 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_rtw_hal_get_def_var (padapter,HW_VAR_MAX_RX_AMPDU_FACTOR , &max_rx_ampdu_factor); - ht_capie.ampdu_params_info = (max_rx_ampdu_factor&0x03 ); + ht_capie.ampdu_params_info = (max_rx_ampdu_factor &0x03 );if (padapter->securitypriv.dot11PrivacyAlgrthm == _AES_) - ht_capie.ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY &(0x07 <<2 )); + ht_capie.ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY & (0x07 <<2 ));else - ht_capie.ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY &0x00 ); + ht_capie.ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY &0x00 ); -rtw_set_ie (out_ie+out_len,WLAN_EID_HT_CAPABILITY , +rtw_set_ie (out_ie + out_len,WLAN_EID_HT_CAPABILITY ,sizeof (struct ieee80211_ht_cap ), (unsigned char *)&ht_capie, pout_len); phtpriv->ht_option = true;
@@ -2421,7 +2421,7 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_ p =rtw_get_ie (in_ie,WLAN_EID_HT_OPERATION , &ielen, in_len);if (p && (ielen ==sizeof (struct ieee80211_ht_addt_info ))) { out_len = *pout_len; -rtw_set_ie (out_ie+out_len,WLAN_EID_HT_OPERATION , ielen, p+2 , pout_len); +rtw_set_ie (out_ie + out_len,WLAN_EID_HT_OPERATION , ielen, p +2 , pout_len); } }
@@ -2453,17 +2453,17 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len, u8 channe/* check Max Rx A-MPDU Size */ len =0 ; - p =rtw_get_ie (pie+sizeof (struct ndis_802_11_fix_ie ),WLAN_EID_HT_CAPABILITY , &len, ie_len-sizeof (struct ndis_802_11_fix_ie )); + p =rtw_get_ie (pie +sizeof (struct ndis_802_11_fix_ie ),WLAN_EID_HT_CAPABILITY , &len, ie_len -sizeof (struct ndis_802_11_fix_ie ));if (p && len >0 ) { - pht_capie = (struct ieee80211_ht_cap *)(p+2 ); + pht_capie = (struct ieee80211_ht_cap *)(p +2 ); max_ampdu_sz = (pht_capie->ampdu_params_info &IEEE80211_HT_CAP_AMPDU_FACTOR ); - max_ampdu_sz =1 << (max_ampdu_sz+3 );/* max_ampdu_sz (kbytes); */ + max_ampdu_sz =1 << (max_ampdu_sz +3 );/* max_ampdu_sz (kbytes); */ phtpriv->rx_ampdu_maxlen = max_ampdu_sz; } len =0 ; - p =rtw_get_ie (pie+sizeof (struct ndis_802_11_fix_ie ),WLAN_EID_HT_OPERATION , &len, ie_len-sizeof (struct ndis_802_11_fix_ie )); + p =rtw_get_ie (pie +sizeof (struct ndis_802_11_fix_ie ),WLAN_EID_HT_OPERATION , &len, ie_len -sizeof (struct ndis_802_11_fix_ie ));if (p && len >0 ) {/* todo: */ }
@@ -2542,8 +2542,8 @@ void rtw_issue_addbareq_cmd(struct adapter *padapter, struct xmit_frame *pxmitfr phtpriv = &psta->htpriv;if (phtpriv->ht_option && phtpriv->ampdu_enable) { - issued = (phtpriv->agg_enable_bitmap>>priority)&0x1 ; - issued |= (phtpriv->candidate_tid_bitmap>>priority)&0x1 ; + issued = (phtpriv->agg_enable_bitmap >> priority) &0x1 ; + issued |= (phtpriv->candidate_tid_bitmap >> priority) &0x1 ;if (issued ==0 ) { psta->htpriv.candidate_tid_bitmap |=BIT ((u8 )priority);
@@ -2614,7 +2614,7 @@ void _rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)signed int rtw_linked_check (struct adapter *padapter) {if ((check_fwstate (&padapter->mlmepriv,WIFI_AP_STATE ) == true) || - (check_fwstate (&padapter->mlmepriv,WIFI_ADHOC_STATE |WIFI_ADHOC_MASTER_STATE ) == true)) { + (check_fwstate (&padapter->mlmepriv,WIFI_ADHOC_STATE |WIFI_ADHOC_MASTER_STATE ) == true)) {if (padapter->stapriv.asoc_sta_count >2 )return true; }else {/* Station mode */
Signature · 1 line
2.34.1