[PATCH v2 1/3] staging: rtl8723bs: rename local vars in phy_tx_power_limit_to_index()

From: Leonardo Martins Martins

Date: Fri Oct 02 2026 - 00:08:32 EST


In phy_tx_power_limit_to_index(), there are many mixed-case local
variables, rename them to adhere to the linux kernel coding style.

Signed-off-by: Leonardo Martins Martins <dev.lmmrtns@xxxxxxxxx>
---
Renamed Variables:
pHalData -> hal_data
Adapter -> adapter
BW40PwrBasedBm2_4G -> pwr_base
rateSection -> rs
tempValue -> tmp
tempPwrLmt -> tmp_pwr_lmt
rfPath -> path

Changes in v2:
- Dropped these two name changes:
regulation -> reg
channel -> ch
---
drivers/staging/rtl8723bs/hal/hal_com_phycfg.c | 44 +++++++++++++-------------
1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
index 3712b38cd37d5d5a923f54cdeb6675223549f740..e98e8a936630cbb6c336ad923234781e718b5c10 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
@@ -739,35 +739,35 @@ s8 phy_get_tx_pwr_lmt(struct adapter *adapter, u32 reg_pwr_tbl_sel,
return pwr_lmt;
}

-void phy_tx_power_limit_to_index(struct adapter *Adapter)
+void phy_tx_power_limit_to_index(struct adapter *adapter)
{
- struct hal_com_data *pHalData = GET_HAL_DATA(Adapter);
- struct registry_priv *r = &Adapter->registrypriv;
- u8 BW40PwrBasedBm2_4G = 0x2E;
- u8 regulation, bw, channel, rateSection;
- s8 tempValue = 0, tempPwrLmt = 0;
- u8 rfPath = 0;
+ struct hal_com_data *hal_data = GET_HAL_DATA(adapter);
+ struct registry_priv *r = &adapter->registrypriv;
+ u8 pwr_base = 0x2E;
+ u8 regulation, bw, channel, rs;
+ s8 tmp = 0, tmp_pwr_lmt = 0;
+ u8 path = 0;

for (regulation = 0; regulation < MAX_REGULATION_NUM; ++regulation) {
for (bw = 0; bw < MAX_2_4G_BANDWIDTH_NUM; ++bw) {
for (channel = 0; channel < CHANNEL_MAX_NUMBER_2G; ++channel) {
- for (rateSection = 0; rateSection < MAX_RATE_SECTION_NUM; ++rateSection) {
- tempPwrLmt = pHalData->TxPwrLimit_2_4G[regulation][bw][rateSection][channel][RF_PATH_A];
-
- for (rfPath = RF_PATH_A; rfPath < MAX_RF_PATH_NUM; ++rfPath) {
- if (pHalData->odmpriv.PhyRegPgValueType == PHY_REG_PG_EXACT_VALUE) {
- if (rateSection == 2) /* HT 1T */
- BW40PwrBasedBm2_4G = PHY_GetTxPowerByRateBase(Adapter, rfPath, HT_MCS0_MCS7);
- else if (rateSection == 1) /* OFDM */
- BW40PwrBasedBm2_4G = PHY_GetTxPowerByRateBase(Adapter, rfPath, OFDM);
- else if (rateSection == 0) /* CCK */
- BW40PwrBasedBm2_4G = PHY_GetTxPowerByRateBase(Adapter, rfPath, CCK);
+ for (rs = 0; rs < MAX_RATE_SECTION_NUM; ++rs) {
+ tmp_pwr_lmt = hal_data->TxPwrLimit_2_4G[regulation][bw][rs][channel][RF_PATH_A];
+
+ for (path = RF_PATH_A; path < MAX_RF_PATH_NUM; ++path) {
+ if (hal_data->odmpriv.PhyRegPgValueType == PHY_REG_PG_EXACT_VALUE) {
+ if (rs == 2) /* HT 1T */
+ pwr_base = PHY_GetTxPowerByRateBase(adapter, path, HT_MCS0_MCS7);
+ else if (rs == 1) /* OFDM */
+ pwr_base = PHY_GetTxPowerByRateBase(adapter, path, OFDM);
+ else if (rs == 0) /* CCK */
+ pwr_base = PHY_GetTxPowerByRateBase(adapter, path, CCK);
} else
- BW40PwrBasedBm2_4G = r->reg_power_base * 2;
+ pwr_base = r->reg_power_base * 2;

- if (tempPwrLmt != MAX_POWER_INDEX) {
- tempValue = tempPwrLmt - BW40PwrBasedBm2_4G;
- pHalData->TxPwrLimit_2_4G[regulation][bw][rateSection][channel][rfPath] = tempValue;
+ if (tmp_pwr_lmt != MAX_POWER_INDEX) {
+ tmp = tmp_pwr_lmt - pwr_base;
+ hal_data->TxPwrLimit_2_4G[regulation][bw][rs][channel][path] = tmp;
}
}
}

--
2.47.3