rename rt_channel_info members to snake_case
cover rename rt_channel_info members to snake_case
his series renames the CamelCase member names ChannelNum and ScanType of struct rt_channel_info to their snake_case equivalents channel_num and scan_type, updating all their usages across the driver.
Note: Some pre-existing checkpatch warnings remain in rtw_mlme_ext.c regarding line length and CamelCase usage unrelated to this series.
Marcos Andrade (3):
staging: rtl8723bs: rename rt_channel_info members to snake_case
staging: rtl8723bs: rename rt_channel_info members to snake_case
staging: rtl8723bs: update rt_channel_info member usage to snake_case
in wifi_reged.c
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 82 +++++++++---------- .../staging/rtl8723bs/include/rtw_mlme_ext.h | 4 +- drivers/staging/rtl8723bs/os_dep/wifi_regd.c | 4 +- 3 files changed, 45 insertions(+), 45 deletions(-)
Signature · 1 line
2.53.0
PATCH 1/3 staging: rtl8723bs: rename rt_channel_info members to snake_case
Rename the CamelCase member names ChannelNum and ScanType of struct rt_channel_info in rtw_mlme_ext.h to their snake_case equivalents channel_num and scan_type.
While at it, fix a pre-existing whitespace issue inside the struct flagged by checkpatch.pl.
This change brings the code in line with the kernel coding style as described in Documentation/process/coding-style.rst.
No functional changes intended.
--- drivers/staging/rtl8723bs/include/rtw_mlme_ext.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8723bs/include/rtw_mlme_ext.h +2 -2
@@ -322,8 +322,8 @@ struct mlme_ext_info {/* The channel information about this channel including joining, scanning, and power constraints. */ struct rt_channel_info { -u8 ChannelNum;/* The channel number. */ -enum rt_scan_type ScanType;/* Scan type such as passive or active scan. */ +u8 channel_num;/* The channel number. */ +enum rt_scan_type scan_type;/* Scan type such as passive or active scan. */ };int rtw_ch_set_search_ch (struct rt_channel_info *ch_set,const u32 ch);
Signature · 1 line
2.53.0
Re: [PATCH 1/3] staging: rtl8723bs: rename rt_channel_info members to snake_case
Quoted 7 lines · Marcos Andrade
Rename the CamelCase member names ChannelNum and ScanType of struct
rt_channel_infoinrtw_mlme_ext.hto theirsnake_caseequivalentschannel_numandscan_type.While at it, fix a pre-existing whitespace issue inside the struct flagged by checkpatch.pl.
Quoted 7 lines
This change brings the code in line with the kernel coding style as described in
Documentation/process/coding-style.rst.No functional changes intended.
Signed-off-by Marcos Andrade <[email protected]>---
This breaks the build.
regards,
dan carpenter
PATCH 2/3 staging: rtl8723bs: rename rt_channel_info members to snake_case
In reply to Marcos AndradeReplace all occurrences of the CamelCase member names ChannelNum and ScanType in rtw_mlme_ext.c with their snake_case equivalents channel_num and scan_type, as defined in struct rt_channel_info.
This change brings the code in line with the kernel coding style as described in Documentation/process/coding-style.rst.
No functional changes intended.
--- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 82 +++++++++---------- 1 file changed, 41 insertions(+), 41 deletions(-)
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +41 -41
@@ -171,12 +171,12 @@ int rtw_ch_set_search_ch(struct rt_channel_info *ch_set, const u32 ch) {int i; -for (i =0 ; ch_set[i].ChannelNum !=0 ; i++) { -if (ch == ch_set[i].ChannelNum) +for (i =0 ; ch_set[i].channel_num !=0 ; i++) { +if (ch == ch_set[i].channel_num)break ; } -if (i >= ch_set[i].ChannelNum) +if (i >= ch_set[i].channel_num)return -1 ;return i; }
@@ -261,7 +261,7 @@ static int has_channel(struct rt_channel_info *channel_set,int i;for (i =0 ; i < chanset_size; i++) -if (channel_set[i].ChannelNum == chan) +if (channel_set[i].channel_num == chan)return 1 ;return 0 ;
@@ -340,22 +340,22 @@ static u8 init_channel_set(struct adapter *padapter, u8 ChannelPlan, struct rt_cif (b2_4GBand) {for (index =0 ; index < RTW_ChannelPlan2G[Index2G].Len; index++) { - channel_set[chanset_size].ChannelNum = RTW_ChannelPlan2G[Index2G].Channel[index]; + channel_set[chanset_size].channel_num = RTW_ChannelPlan2G[Index2G].Channel[index];if ((ChannelPlan ==RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN ) ||/* Channel 1~11 is active, and 12~14 is passive */ (ChannelPlan ==RT_CHANNEL_DOMAIN_GLOBAL_NULL )) { -if (channel_set[chanset_size].ChannelNum >=1 && channel_set[chanset_size].ChannelNum <=11 ) - channel_set[chanset_size].ScanType =SCAN_ACTIVE ; -else if ((channel_set[chanset_size].ChannelNum >=12 && channel_set[chanset_size].ChannelNum <=14 )) - channel_set[chanset_size].ScanType =SCAN_PASSIVE ; +if (channel_set[chanset_size].channel_num >=1 && channel_set[chanset_size].channel_num <=11 ) + channel_set[chanset_size].scan_type =SCAN_ACTIVE ; +else if ((channel_set[chanset_size].channel_num >=12 && channel_set[chanset_size].channel_num <=14 )) + channel_set[chanset_size].scan_type =SCAN_PASSIVE ; }else if (ChannelPlan ==RT_CHANNEL_DOMAIN_WORLD_WIDE_13 || Index2G ==RT_CHANNEL_DOMAIN_2G_WORLD ) {/* channel 12~13, passive scan */ -if (channel_set[chanset_size].ChannelNum <=11 ) - channel_set[chanset_size].ScanType =SCAN_ACTIVE ; +if (channel_set[chanset_size].channel_num <=11 ) + channel_set[chanset_size].scan_type =SCAN_ACTIVE ;else - channel_set[chanset_size].ScanType =SCAN_PASSIVE ; + channel_set[chanset_size].scan_type =SCAN_PASSIVE ; }else - channel_set[chanset_size].ScanType =SCAN_ACTIVE ; + channel_set[chanset_size].scan_type =SCAN_ACTIVE ; chanset_size++; }
@@ -4279,27 +4279,27 @@ static void process_80211d(struct adapter *padapter, struct wlan_bssid_ex *bssidif (pregistrypriv->wireless_mode &WIRELESS_11G ) { do { if ((i == MAX_CHANNEL_NUM) || - (chplan_sta[i].ChannelNum == 0) || - (chplan_sta[i].ChannelNum > 14)) + (chplan_sta[i].channel_num == 0) || + (chplan_sta[i].channel_num > 14)) break; if ((j == chplan_ap.Len) || (chplan_ap.Channel[j] > 14)) break; - if (chplan_sta[i].ChannelNum == chplan_ap.Channel[j]) { - chplan_new[k].ChannelNum = chplan_ap.Channel[j]; - chplan_new[k].ScanType = SCAN_ACTIVE; + if (chplan_sta[i].channel_num == chplan_ap.Channel[j]) { + chplan_new[k].channel_num = chplan_ap.Channel[j]; + chplan_new[k].scan_type = SCAN_ACTIVE; i++; j++; k++; - } else if (chplan_sta[i].ChannelNum < chplan_ap.Channel[j]) { - chplan_new[k].ChannelNum = chplan_sta[i].ChannelNum; - chplan_new[k].ScanType = SCAN_PASSIVE; + } else if (chplan_sta[i].channel_num < chplan_ap.Channel[j]) { + chplan_new[k].channel_num = chplan_sta[i].scan_type; + chplan_new[k].scan_type = SCAN_PASSIVE; i++; k++; - } else if (chplan_sta[i].ChannelNum > chplan_ap.Channel[j]) { - chplan_new[k].ChannelNum = chplan_ap.Channel[j]; - chplan_new[k].ScanType = SCAN_ACTIVE; + } else if (chplan_sta[i].channel_num > chplan_ap.Channel[j]) { + chplan_new[k].channel_num = chplan_ap.Channel[j]; + chplan_new[k].scan_type = SCAN_ACTIVE; j++; k++; }
@@ -4307,29 +4307,29 @@ static void process_80211d(struct adapter *padapter, struct wlan_bssid_ex *bssid/* change AP not support channel to Passive scan */ while ((i <MAX_CHANNEL_NUM ) && - (chplan_sta[i].ChannelNum !=0 ) && - (chplan_sta[i].ChannelNum <=14 )) { + (chplan_sta[i].channel_num !=0 ) && + (chplan_sta[i].channel_num <=14 )) { - chplan_new[k].ChannelNum = chplan_sta[i].ChannelNum; - chplan_new[k].ScanType =SCAN_PASSIVE ; + chplan_new[k].channel_num = chplan_sta[i].channel_num; + chplan_new[k].scan_type =SCAN_PASSIVE ; i++; k++; }/* add channel AP supported */ while ((j < chplan_ap.Len) && (chplan_ap.Channel[j] <=14 )) { - chplan_new[k].ChannelNum = chplan_ap.Channel[j]; - chplan_new[k].ScanType =SCAN_ACTIVE ; + chplan_new[k].channel_num = chplan_ap.Channel[j]; + chplan_new[k].scan_type =SCAN_ACTIVE ; j++; k++; } }else {/* keep original STA 2.4G channel plan */ while ((i <MAX_CHANNEL_NUM ) && - (chplan_sta[i].ChannelNum !=0 ) && - (chplan_sta[i].ChannelNum <=14 )) { - chplan_new[k].ChannelNum = chplan_sta[i].ChannelNum; - chplan_new[k].ScanType = chplan_sta[i].ScanType; + (chplan_sta[i].channel_num !=0 ) && + (chplan_sta[i].channel_num <=14 )) { + chplan_new[k].channel_num = chplan_sta[i].channel_num; + chplan_new[k].scan_type = chplan_sta[i].scan_type; i++; k++; }
@@ -4346,10 +4346,10 @@ static void process_80211d(struct adapter *padapter, struct wlan_bssid_ex *bssid channel = bssid->configuration.ds_config; chplan_new = pmlmeext->channel_set; i =0 ; -while ((i <MAX_CHANNEL_NUM ) && (chplan_new[i].ChannelNum !=0 )) { -if (chplan_new[i].ChannelNum == channel) { -if (chplan_new[i].ScanType ==SCAN_PASSIVE ) - chplan_new[i].ScanType =SCAN_ACTIVE ; +while ((i <MAX_CHANNEL_NUM ) && (chplan_new[i].channel_num !=0 )) { +if (chplan_new[i].channel_num == channel) { +if (chplan_new[i].scan_type ==SCAN_PASSIVE ) + chplan_new[i].scan_type =SCAN_ACTIVE ;break ; } i++;
@@ -5448,7 +5448,7 @@ static int rtw_scan_ch_decision(struct adapter *padapter, struct rtw_ieee80211_cmemcpy (&out[j], &in[i],sizeof (struct rtw_ieee80211_channel )); -if (pmlmeext->channel_set[set_idx].ScanType ==SCAN_PASSIVE ) +if (pmlmeext->channel_set[set_idx].scan_type ==SCAN_PASSIVE ) out[j].flags |=RTW_IEEE80211_CHAN_PASSIVE_SCAN ; j++;
@@ -5469,9 +5469,9 @@ static int rtw_scan_ch_decision(struct adapter *padapter, struct rtw_ieee80211_cbreak ; } - out[j].hw_value = pmlmeext->channel_set[i].ChannelNum; + out[j].hw_value = pmlmeext->channel_set[i].channel_num; -if (pmlmeext->channel_set[i].ScanType ==SCAN_PASSIVE ) +if (pmlmeext->channel_set[i].scan_type ==SCAN_PASSIVE ) out[j].flags |=RTW_IEEE80211_CHAN_PASSIVE_SCAN ; j++;
Signature · 1 line
2.53.0
Re: [PATCH 2/3] staging: rtl8723bs: rename rt_channel_info members to snake_case
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c static void process_80211d(struct adapter *padapter, struct wlan_bssid_ex *bssid · line 4296
Quoted 8 lines · Marcos Andrade
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +2
-3i++; j++; k++; - }else if (chplan_sta[i].ChannelNum < chplan_ap.Channel[j]) { - chplan_new[k].ChannelNum = chplan_sta[i].ChannelNum; - chplan_new[k].ScanType =SCAN_PASSIVE ; + }else if (chplan_sta[i].channel_num < chplan_ap.Channel[j]) { + chplan_new[k].channel_num = chplan_sta[i].scan_type;
^^^^^^^^^
You changed this from .channel_num to .scan_type... Please, be more careful.
regards,
dan carpenter
Quoted 12 lines
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +4
-3+ chplan_new[k].scan_type =SCAN_PASSIVE ; i++; k++; - }else if (chplan_sta[i].ChannelNum > chplan_ap.Channel[j]) { - chplan_new[k].ChannelNum = chplan_ap.Channel[j]; - chplan_new[k].ScanType =SCAN_ACTIVE ; + }else if (chplan_sta[i].channel_num > chplan_ap.Channel[j]) { + chplan_new[k].channel_num = chplan_ap.Channel[j]; + chplan_new[k].scan_type =SCAN_ACTIVE ; j++; k++; }
PATCH 3/3 staging: rtl8723bs: update rt_channel_info member usage to snake_case in wifi_reged.c
In reply to Marcos AndradeReplace all occurrences of the CamelCase member names ChannelNum and ScanType in os_dep/wifi_reged.c with their snake_case equivalents channel_num and scan_type, as defined in struct rt_channel_info.
This change brings the code in line with the kernel coding style as described in Documentation/process/coding-style.rst.
No functional changes intended.
--- drivers/staging/rtl8723bs/os_dep/wifi_regd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8723bs/os_dep/wifi_regd.c +2 -2
@@ -70,11 +70,11 @@ static void _rtw_reg_apply_flags(struct wiphy *wiphy)/* channels apply by channel plans. */ for (i =0 ; i < max_chan_nums; i++) { - channel = channel_set[i].ChannelNum; + channel = channel_set[i].channel_num; freq =rtw_ieee80211_channel_to_frequency (channel); ch =ieee80211_get_channel (wiphy, freq);if (ch) { -if (channel_set[i].ScanType ==SCAN_PASSIVE ) +if (channel_set[i].scan_type ==SCAN_PASSIVE ) ch->flags =IEEE80211_CHAN_NO_IR ;else ch->flags =0 ;
Signature · 1 line
2.53.0