Skip to contentSkip to conversation

staging: rtl8192e: renamed variable TxCountToDataRate

PATCH Superseded Gary Rookard 3 participants 4 messages Oct 21, 2023 – Oct 30, 2023 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 staging: rtl8192e: renamed variable TxCountToDataRate

Renamed from Pascal/CamelCase to Snake case the variable TxCountDataRate, TxCountDataRate -> tx_count_data_rate.

Linux kernel coding style (cleanup), checkpatch Avoid CamelCase. Driver rtl8192e compiles.

---
Removed parenthesis alignment, and removed corrected spacing from this patch. Only contains renaming variable.

 drivers/staging/rtl8192e/rtl819x_HTProc.c    | 2 +-
 drivers/staging/rtl8192e/rtllib.h            | 2 +-
 drivers/staging/rtl8192e/rtllib_softmac_wx.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8192e/rtl819x_HTProc.c +1 -1
index 00b21542ddc3..8070a152712e 100644
@@ -114,7 +114,7 @@ static u16 HTMcsToDataRate(struct rtllib_device *ieee, u8 nMcsRate)
 	return MCS_DATA_RATE[is40MHz][isShortGI][(nMcsRate & 0x7f)];
 }
 
-u16  TxCountToDataRate(struct rtllib_device *ieee, u8 nDataRate)
+u16  tx_count_to_data_rate(struct rtllib_device *ieee, u8 nDataRate)
 {
 	u16	CCKOFDMRate[12] = {0x02, 0x04, 0x0b, 0x16, 0x0c, 0x12, 0x18,
 				   0x24, 0x30, 0x48, 0x60, 0x6c};
drivers/staging/rtl8192e/rtllib.h +1 -1
index 9d141aad8cd5..6a9550eaf148 100644
@@ -1784,7 +1784,7 @@ extern u16 MCS_DATA_RATE[2][2][77];
 u8 HTCCheck(struct rtllib_device *ieee, u8 *pFrame);
 void HTResetIOTSetting(struct rt_hi_throughput *ht_info);
 bool IsHTHalfNmodeAPs(struct rtllib_device *ieee);
-u16  TxCountToDataRate(struct rtllib_device *ieee, u8 nDataRate);
+u16  tx_count_data_rate(struct rtllib_device *ieee, u8 nDataRate);
 int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb);
 int rtllib_rx_ADDBARsp(struct rtllib_device *ieee, struct sk_buff *skb);
 int rtllib_rx_DELBA(struct rtllib_device *ieee, struct sk_buff *skb);
drivers/staging/rtl8192e/rtllib_softmac_wx.c +1 -1
index f32584291704..28aba1d610f7 100644
@@ -208,7 +208,7 @@ int rtllib_wx_get_rate(struct rtllib_device *ieee,
 {
 	u32 tmp_rate;
 
-	tmp_rate = TxCountToDataRate(ieee,
+	tmp_rate = tx_count_to_data_rate(ieee,
 				     ieee->softmac_stats.CurrentShowTxate);
 	wrqu->bitrate.value = tmp_rate * 500000;
 
Signature · 1 line
2.41.0
#1 lore raw
Quoted 21 lines · Gary Rookard

Renamed from Pascal/CamelCase to Snake case the variable TxCountDataRate, TxCountDataRate -> tx_count_data_rate.

Linux kernel coding style (cleanup), checkpatch Avoid CamelCase. Driver rtl8192e compiles.

---
Removed parenthesis alignment, and removed corrected spacing from this patch. Only contains renaming variable.

  drivers/staging/rtl8192e/rtl819x_HTProc.c    | 2 +-
  drivers/staging/rtl8192e/rtllib.h            | 2 +-
  drivers/staging/rtl8192e/rtllib_softmac_wx.c | 2 +-
  3 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8192e/rtl819x_HTProc.c +0 -0
index 00b21542ddc3..8070a152712e 100644

drivers/staging/rtl8192e/rtl819x_HTProc.c static u16 HTMcsToDataRate(struct rtllib_device *ieee, u8 nMcsRate) · line 117

Quoted 5 lines
drivers/staging/rtl8192e/rtl819x_HTProc.c +1 -1
@@ -114,7 +114,7 @@ static u16 HTMcsToDataRate(struct rtllib_device *ieee, u8 nMcsRate)
  	return MCS_DATA_RATE[is40MHz][isShortGI][(nMcsRate & 0x7f)];
  }
 
-u16  TxCountToDataRate(struct rtllib_device *ieee, u8 nDataRate)
+u16  tx_count_to_data_rate(struct rtllib_device *ieee, u8 nDataRate)

tx_count_to_data_rate

drivers/staging/rtl8192e/rtllib.h extern u16 MCS_DATA_RATE[2][2][77]; · line 1787

Quoted 13 lines
drivers/staging/rtl8192e/rtl819x_HTProc.c +0 -0
  {
  	u16	CCKOFDMRate[12] = {0x02, 0x04, 0x0b, 0x16, 0x0c, 0x12, 0x18,
  				   0x24, 0x30, 0x48, 0x60, 0x6c};
drivers/staging/rtl8192e/rtllib.h +1 -1
index 9d141aad8cd5..6a9550eaf148 100644
@@ -1784,7 +1784,7 @@ extern u16 MCS_DATA_RATE[2][2][77];
  u8 HTCCheck(struct rtllib_device *ieee, u8 *pFrame);
  void HTResetIOTSetting(struct rt_hi_throughput *ht_info);
  bool IsHTHalfNmodeAPs(struct rtllib_device *ieee);
-u16  TxCountToDataRate(struct rtllib_device *ieee, u8 nDataRate);
+u16  tx_count_data_rate(struct rtllib_device *ieee, u8 nDataRate);

tx_count_data_rate

drivers/staging/rtl8192e/rtllib_softmac_wx.c int rtllib_wx_get_rate(struct rtllib_device *ieee, · line 211

Quoted 13 lines
drivers/staging/rtl8192e/rtllib.h +0 -0
  int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb);
  int rtllib_rx_ADDBARsp(struct rtllib_device *ieee, struct sk_buff *skb);
  int rtllib_rx_DELBA(struct rtllib_device *ieee, struct sk_buff *skb);
drivers/staging/rtl8192e/rtllib_softmac_wx.c +1 -1
index f32584291704..28aba1d610f7 100644
@@ -208,7 +208,7 @@ int rtllib_wx_get_rate(struct rtllib_device *ieee,
  {
  	u32 tmp_rate;
 
-	tmp_rate = TxCountToDataRate(ieee,
+	tmp_rate = tx_count_to_data_rate(ieee,

tx_count_to_data_rate

drivers/staging/rtl8192e/rtllib_softmac_wx.c int rtllib_wx_get_rate(struct rtllib_device *ieee, · line 214

Quoted 3 lines
drivers/staging/rtl8192e/rtllib_softmac_wx.c +0 -0
  				     ieee->softmac_stats.CurrentShowTxate);
  	wrqu->bitrate.value = tmp_rate * 500000;
 

Hi,

name of the function are different.

You need to do a compile testing before sending in.

drivers/staging/rtl8192e/rtllib_softmac_wx.c: In function ‘rtllib_wx_get_rate’:
drivers/staging/rtl8192e/rtllib_softmac_wx.c:211:13: error: implicit declaration of function ‘tx_count_to_data_rate’; did you mean ‘tx_count_data_rate’? [-Werror=implicit-function-declaration]

  211 |  tmp_rate = tx_count_to_data_rate(ieee,
      |             ^~~~~~~~~~~~~~~~~~~~~
      |             tx_count_data_rate

cc1: some warnings being treated as errors

Bye Philipp

#2 lore raw
In reply to Gary Rookard
kernel test robot noticed the following build warnings:

Hi Gary,

kernel test robot noticed the following build warnings:

[auto build test WARNING on staging/staging-testing]

url:    https://github.com/intel-lab-lkp/linux/commits/Gary-Rookard/staging-rtl8192e-renamed-variable-TxCountToDataRate/20231022-061649
base:   staging/staging-testing
patch link:    https://lore.kernel.org/r/20231021215440.6584-1-garyrookard%40fastmail.org
patch subject: [PATCH v3] staging: rtl8192e: renamed variable TxCountToDataRate
config: i386-buildonly-randconfig-002-20231026 (https://download.01.org/0day-ci/archive/20231026/[email protected]/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231026/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

>> drivers/staging/rtl8192e/rtl819x_HTProc.c:117:6: warning: no previous declaration for 'tx_count_to_data_rate' [-Wmissing-declarations]

u16 tx_count_to_data_rate(struct rtllib_device *ieee, u8 nDataRate)
^~~~~~~~~~~~~~~~~~~~~

vim +/tx_count_to_data_rate +117 drivers/staging/rtl8192e/rtl819x_HTProc.c

116

 > 117	u16  tx_count_to_data_rate(struct rtllib_device *ieee, u8 nDataRate)

118 {
119 u16 CCKOFDMRate[12] = {0x02, 0x04, 0x0b, 0x16, 0x0c, 0x12, 0x18,
120 0x24, 0x30, 0x48, 0x60, 0x6c};
121 u8 is40MHz = 0;
122 u8 isShortGI = 0;
123
124 if (nDataRate < 12)
125 return CCKOFDMRate[nDataRate];
126 if (nDataRate >= 0x10 && nDataRate <= 0x1f) {
127 is40MHz = 0;
128 isShortGI = 0;
129 } else if (nDataRate >= 0x20 && nDataRate <= 0x2f) {
130 is40MHz = 1;
131 isShortGI = 0;
132 } else if (nDataRate >= 0x30 && nDataRate <= 0x3f) {
133 is40MHz = 0;
134 isShortGI = 1;
135 } else if (nDataRate >= 0x40 && nDataRate <= 0x4f) {
136 is40MHz = 1;
137 isShortGI = 1;
138 }
139 return MCS_DATA_RATE[is40MHz][isShortGI][nDataRate & 0xf];
140 }
141

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#3 lore raw
In reply to Gary Rookard
kernel test robot noticed the following build errors:

Hi Gary,

kernel test robot noticed the following build errors:

[auto build test ERROR on staging/staging-testing]

url:    https://github.com/intel-lab-lkp/linux/commits/Gary-Rookard/staging-rtl8192e-renamed-variable-TxCountToDataRate/20231022-061649
base:   staging/staging-testing
patch link:    https://lore.kernel.org/r/20231021215440.6584-1-garyrookard%40fastmail.org
patch subject: [PATCH v3] staging: rtl8192e: renamed variable TxCountToDataRate
config: openrisc-allyesconfig (https://download.01.org/0day-ci/archive/20231031/[email protected]/config)
compiler: or1k-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231031/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

drivers/staging/rtl8192e/rtllib_softmac_wx.c: In function 'rtllib_wx_get_rate':

>> drivers/staging/rtl8192e/rtllib_softmac_wx.c:211:20: error: implicit declaration of function 'tx_count_to_data_rate'; did you mean 'tx_count_data_rate'? [-Werror=implicit-function-declaration]
     211 |         tmp_rate = tx_count_to_data_rate(ieee,
         |                    ^~~~~~~~~~~~~~~~~~~~~
         |                    tx_count_data_rate

cc1: some warnings being treated as errors

vim +211 drivers/staging/rtl8192e/rtllib_softmac_wx.c

204
205 int rtllib_wx_get_rate(struct rtllib_device *ieee,
206 struct iw_request_info *info,
207 union iwreq_data *wrqu, char *extra)
208 {
209 u32 tmp_rate;
210

 > 211		tmp_rate = tx_count_to_data_rate(ieee,

212 ieee->softmac_stats.CurrentShowTxate);
213 wrqu->bitrate.value = tmp_rate * 500000;
214
215 return 0;
216 }
217 EXPORT_SYMBOL(rtllib_wx_get_rate);
218

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki