[PATCH 03/11] staging: rtl8723bs: Fix camel-case names in phy_get_tx_pwr_lmt().

2018-06-16 Thread Quytelda Kahja
Change camel-case names to snake-case names; to avoid variable name
conflicts, rename table index variables to idx_*.

Signed-off-by: Quytelda Kahja 
---
 .../staging/rtl8723bs/hal/hal_com_phycfg.c| 200 +-
 1 file changed, 105 insertions(+), 95 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c 
b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
index 4ab624f5ece0..7e27d7ff29fa 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
@@ -1612,211 +1612,221 @@ static s8 phy_GetChannelIndexOfTxPowerLimit(u8 Band, 
u8 Channel)
return channelIndex;
 }
 
-s8 phy_get_tx_pwr_lmt(struct adapter *Adapter, u32 RegPwrTblSel,
- enum BAND_TYPE Band, enum CHANNEL_WIDTH Bandwidth,
- u8 RfPath, u8 DataRate, u8 Channel)
+s8 phy_get_tx_pwr_lmt(struct adapter *adapter, u32 reg_pwr_tbl_sel,
+ enum BAND_TYPE band_type, enum CHANNEL_WIDTH bandwidth,
+ u8 rf_path, u8 data_rate, u8 channel)
 {
-   s16 band= -1;
-   s16 regulation  = -1;
-   s16 bandwidth   = -1;
-   s16 rateSection = -1;
-   s16 channel = -1;
-   s8 powerLimit = MAX_POWER_INDEX;
-   struct hal_com_data *pHalData = GET_HAL_DATA(Adapter);
-
-   if (((Adapter->registrypriv.RegEnableTxPowerLimit == 2) &&
-(pHalData->EEPROMRegulatory != 1)) ||
-   (Adapter->registrypriv.RegEnableTxPowerLimit == 0))
+   s16 idx_band   = -1;
+   s16 idx_regulation = -1;
+   s16 idx_bandwidth  = -1;
+   s16 idx_rate_sctn  = -1;
+   s16 idx_channel= -1;
+   s8 pwr_lmt = MAX_POWER_INDEX;
+   struct hal_com_data *hal_data = GET_HAL_DATA(adapter);
+
+   if (((adapter->registrypriv.RegEnableTxPowerLimit == 2) &&
+(hal_data->EEPROMRegulatory != 1)) ||
+   (adapter->registrypriv.RegEnableTxPowerLimit == 0))
return MAX_POWER_INDEX;
 
-   switch (Adapter->registrypriv.RegPwrTblSel) {
+   switch (adapter->registrypriv.RegPwrTblSel) {
case 1:
-   regulation = TXPWR_LMT_ETSI;
+   idx_regulation = TXPWR_LMT_ETSI;
break;
case 2:
-   regulation = TXPWR_LMT_MKK;
+   idx_regulation = TXPWR_LMT_MKK;
break;
case 3:
-   regulation = TXPWR_LMT_FCC;
+   idx_regulation = TXPWR_LMT_FCC;
break;
case 4:
-   regulation = TXPWR_LMT_WW;
+   idx_regulation = TXPWR_LMT_WW;
break;
default:
-   regulation = (Band == BAND_ON_2_4G) ?
-   pHalData->Regulation2_4G :
-   pHalData->Regulation5G;
+   idx_regulation = (band_type == BAND_ON_2_4G) ?
+   hal_data->Regulation2_4G :
+   hal_data->Regulation5G;
break;
}
 
/* DBG_871X("pMgntInfo->RegPwrTblSel %d, final regulation %d\n", */
-   /* Adapter->registrypriv.RegPwrTblSel, regulation); */
-
-   if (Band == BAND_ON_2_4G)
-   band = 0;
-   else if (Band == BAND_ON_5G)
-   band = 1;
-
-   if (Bandwidth == CHANNEL_WIDTH_20)
-   bandwidth = 0;
-   else if (Bandwidth == CHANNEL_WIDTH_40)
-   bandwidth = 1;
-   else if (Bandwidth == CHANNEL_WIDTH_80)
-   bandwidth = 2;
-   else if (Bandwidth == CHANNEL_WIDTH_160)
-   bandwidth = 3;
-
-   switch (DataRate) {
+   /* adapter->registrypriv.RegPwrTblSel, idx_regulation); */
+
+   if (band_type == BAND_ON_2_4G)
+   idx_band = 0;
+   else if (band_type == BAND_ON_5G)
+   idx_band = 1;
+
+   if (bandwidth == CHANNEL_WIDTH_20)
+   idx_bandwidth = 0;
+   else if (bandwidth == CHANNEL_WIDTH_40)
+   idx_bandwidth = 1;
+   else if (bandwidth == CHANNEL_WIDTH_80)
+   idx_bandwidth = 2;
+   else if (bandwidth == CHANNEL_WIDTH_160)
+   idx_bandwidth = 3;
+
+   switch (data_rate) {
case MGN_1M: case MGN_2M: case MGN_5_5M: case MGN_11M:
-   rateSection = 0;
+   idx_rate_sctn = 0;
break;
 
case MGN_6M: case MGN_9M: case MGN_12M: case MGN_18M:
case MGN_24M: case MGN_36M: case MGN_48M: case MGN_54M:
-   rateSection = 1;
+   idx_rate_sctn = 1;
break;
 
case MGN_MCS0: case MGN_MCS1: case MGN_MCS2: case MGN_MCS3:
case MGN_MCS4: case MGN_MCS5: case MGN_MCS6: case MGN_MCS7:
-   rateSection = 2;
+   idx_rate_sctn = 2;
break;
 
case MGN_MCS8: case MGN_MCS9: case MGN_MCS10: case MGN_MCS11:
case MGN_MCS12: case MGN_MCS13: case MGN_MCS14: case MGN_MCS15:
-   rateSection = 3;
+   

[PATCH 03/11] staging: rtl8723bs: Fix camel-case names in phy_get_tx_pwr_lmt().

2018-06-16 Thread Quytelda Kahja
Change camel-case names to snake-case names; to avoid variable name
conflicts, rename table index variables to idx_*.

Signed-off-by: Quytelda Kahja 
---
 .../staging/rtl8723bs/hal/hal_com_phycfg.c| 200 +-
 1 file changed, 105 insertions(+), 95 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c 
b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
index 4ab624f5ece0..7e27d7ff29fa 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
@@ -1612,211 +1612,221 @@ static s8 phy_GetChannelIndexOfTxPowerLimit(u8 Band, 
u8 Channel)
return channelIndex;
 }
 
-s8 phy_get_tx_pwr_lmt(struct adapter *Adapter, u32 RegPwrTblSel,
- enum BAND_TYPE Band, enum CHANNEL_WIDTH Bandwidth,
- u8 RfPath, u8 DataRate, u8 Channel)
+s8 phy_get_tx_pwr_lmt(struct adapter *adapter, u32 reg_pwr_tbl_sel,
+ enum BAND_TYPE band_type, enum CHANNEL_WIDTH bandwidth,
+ u8 rf_path, u8 data_rate, u8 channel)
 {
-   s16 band= -1;
-   s16 regulation  = -1;
-   s16 bandwidth   = -1;
-   s16 rateSection = -1;
-   s16 channel = -1;
-   s8 powerLimit = MAX_POWER_INDEX;
-   struct hal_com_data *pHalData = GET_HAL_DATA(Adapter);
-
-   if (((Adapter->registrypriv.RegEnableTxPowerLimit == 2) &&
-(pHalData->EEPROMRegulatory != 1)) ||
-   (Adapter->registrypriv.RegEnableTxPowerLimit == 0))
+   s16 idx_band   = -1;
+   s16 idx_regulation = -1;
+   s16 idx_bandwidth  = -1;
+   s16 idx_rate_sctn  = -1;
+   s16 idx_channel= -1;
+   s8 pwr_lmt = MAX_POWER_INDEX;
+   struct hal_com_data *hal_data = GET_HAL_DATA(adapter);
+
+   if (((adapter->registrypriv.RegEnableTxPowerLimit == 2) &&
+(hal_data->EEPROMRegulatory != 1)) ||
+   (adapter->registrypriv.RegEnableTxPowerLimit == 0))
return MAX_POWER_INDEX;
 
-   switch (Adapter->registrypriv.RegPwrTblSel) {
+   switch (adapter->registrypriv.RegPwrTblSel) {
case 1:
-   regulation = TXPWR_LMT_ETSI;
+   idx_regulation = TXPWR_LMT_ETSI;
break;
case 2:
-   regulation = TXPWR_LMT_MKK;
+   idx_regulation = TXPWR_LMT_MKK;
break;
case 3:
-   regulation = TXPWR_LMT_FCC;
+   idx_regulation = TXPWR_LMT_FCC;
break;
case 4:
-   regulation = TXPWR_LMT_WW;
+   idx_regulation = TXPWR_LMT_WW;
break;
default:
-   regulation = (Band == BAND_ON_2_4G) ?
-   pHalData->Regulation2_4G :
-   pHalData->Regulation5G;
+   idx_regulation = (band_type == BAND_ON_2_4G) ?
+   hal_data->Regulation2_4G :
+   hal_data->Regulation5G;
break;
}
 
/* DBG_871X("pMgntInfo->RegPwrTblSel %d, final regulation %d\n", */
-   /* Adapter->registrypriv.RegPwrTblSel, regulation); */
-
-   if (Band == BAND_ON_2_4G)
-   band = 0;
-   else if (Band == BAND_ON_5G)
-   band = 1;
-
-   if (Bandwidth == CHANNEL_WIDTH_20)
-   bandwidth = 0;
-   else if (Bandwidth == CHANNEL_WIDTH_40)
-   bandwidth = 1;
-   else if (Bandwidth == CHANNEL_WIDTH_80)
-   bandwidth = 2;
-   else if (Bandwidth == CHANNEL_WIDTH_160)
-   bandwidth = 3;
-
-   switch (DataRate) {
+   /* adapter->registrypriv.RegPwrTblSel, idx_regulation); */
+
+   if (band_type == BAND_ON_2_4G)
+   idx_band = 0;
+   else if (band_type == BAND_ON_5G)
+   idx_band = 1;
+
+   if (bandwidth == CHANNEL_WIDTH_20)
+   idx_bandwidth = 0;
+   else if (bandwidth == CHANNEL_WIDTH_40)
+   idx_bandwidth = 1;
+   else if (bandwidth == CHANNEL_WIDTH_80)
+   idx_bandwidth = 2;
+   else if (bandwidth == CHANNEL_WIDTH_160)
+   idx_bandwidth = 3;
+
+   switch (data_rate) {
case MGN_1M: case MGN_2M: case MGN_5_5M: case MGN_11M:
-   rateSection = 0;
+   idx_rate_sctn = 0;
break;
 
case MGN_6M: case MGN_9M: case MGN_12M: case MGN_18M:
case MGN_24M: case MGN_36M: case MGN_48M: case MGN_54M:
-   rateSection = 1;
+   idx_rate_sctn = 1;
break;
 
case MGN_MCS0: case MGN_MCS1: case MGN_MCS2: case MGN_MCS3:
case MGN_MCS4: case MGN_MCS5: case MGN_MCS6: case MGN_MCS7:
-   rateSection = 2;
+   idx_rate_sctn = 2;
break;
 
case MGN_MCS8: case MGN_MCS9: case MGN_MCS10: case MGN_MCS11:
case MGN_MCS12: case MGN_MCS13: case MGN_MCS14: case MGN_MCS15:
-   rateSection = 3;
+