mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] staging: rtl8723bs: refactor PHY_ConvertTxPowerLimitToPowerIndex()
@ 2026-09-27  1:12 Leonardo Martins Martins
  2026-09-27  1:12 ` [PATCH 1/4] staging: rtl8723bs: rename PHY_ConvertTxPowerLimitToPowerIndex() Leonardo Martins Martins
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Leonardo Martins Martins @ 2026-09-27  1:12 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-staging, linux-kernel, Leonardo Martins Martins

The function PHY_ConvertTxPowerLimitToPowerIndex() has several style
problems, such as mixed-case names, deeply nested code, and redundant
bounds checking.

Patches 1 and 2 rename mixed-case names that are on the same scope as
this function, struct fields such as TxPwrLimit_2_4G were left as is.
Patch 3 removes redundant parts of the code, and patch 4 solves the
nesting issue by extracting the inner loop into an auxiliary function
like it is done in rtw_phy_tx_power_limit_config(), at
drivers/net/wireless/realtek/rtw88/phy.c

Checkpatch issues a few warnings and checks for deep nesting and long
lines, but these are solved by the last patch.

Compile tested only.

Signed-off-by: Leonardo Martins Martins <dev.lmmrtns@gmail.com>
---
Leonardo Martins Martins (4):
      staging: rtl8723bs: rename PHY_ConvertTxPowerLimitToPowerIndex()
      staging: rtl8723bs: rename local vars in phy_tx_power_limit_to_index()
      staging: rtl8723bs: access TxPowerByRateBase2_4G directly
      staging: rtl8723bs: extract inner loop in phy_tx_power_limit_to_index()

 drivers/staging/rtl8723bs/hal/hal_com_phycfg.c     | 88 ++++++++--------------
 drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c    |  2 +-
 drivers/staging/rtl8723bs/include/hal_com_phycfg.h |  5 +-
 3 files changed, 32 insertions(+), 63 deletions(-)
---
base-commit: 8444548bd905f22093729065408284a6b46f7eee
change-id: 20260922-rtl8723bs-tx-pwr-limit-9a19bb9f901e

Best regards,
-- 
Leonardo Martins Martins <dev.lmmrtns@gmail.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/4] staging: rtl8723bs: rename PHY_ConvertTxPowerLimitToPowerIndex()
  2026-09-27  1:12 [PATCH 0/4] staging: rtl8723bs: refactor PHY_ConvertTxPowerLimitToPowerIndex() Leonardo Martins Martins
@ 2026-09-27  1:12 ` Leonardo Martins Martins
  2026-09-27  1:12 ` [PATCH 2/4] staging: rtl8723bs: rename local vars in phy_tx_power_limit_to_index() Leonardo Martins Martins
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Leonardo Martins Martins @ 2026-09-27  1:12 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-staging, linux-kernel, Leonardo Martins Martins

Rename function PHY_ConvertTxPowerLimitToPowerIndex() to
phy_tx_power_limit_to_index().

Signed-off-by: Leonardo Martins Martins <dev.lmmrtns@gmail.com>
---
 drivers/staging/rtl8723bs/hal/hal_com_phycfg.c     | 2 +-
 drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c    | 2 +-
 drivers/staging/rtl8723bs/include/hal_com_phycfg.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
index df0eaff4c84114eb583c9b91ca7babdafe6a28da..1228be0cbc839041384f3e434d22b4f039d69986 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
@@ -739,7 +739,7 @@ s8 phy_get_tx_pwr_lmt(struct adapter *adapter, u32 reg_pwr_tbl_sel,
 	return pwr_lmt;
 }
 
-void PHY_ConvertTxPowerLimitToPowerIndex(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;
diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c
index 737e2a818c18d7708df8d743f4947b86461cd0f3..44b4dd69af3a03b21abf4307a515c639863efb42 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c
@@ -352,7 +352,7 @@ static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter)
 		if (Adapter->registrypriv.reg_enable_tx_power_limit == 1 ||
 		    (Adapter->registrypriv.reg_enable_tx_power_limit == 2 &&
 		   pHalData->EEPROMRegulatory == 1))
-			PHY_ConvertTxPowerLimitToPowerIndex(Adapter);
+			phy_tx_power_limit_to_index(Adapter);
 	}
 
 	/*  */
diff --git a/drivers/staging/rtl8723bs/include/hal_com_phycfg.h b/drivers/staging/rtl8723bs/include/hal_com_phycfg.h
index cb7c7ed74146844032add0736eb7dc41b4b4a6d9..a20b4c233de8128fe20e41dee2b303a4662f4de4 100644
--- a/drivers/staging/rtl8723bs/include/hal_com_phycfg.h
+++ b/drivers/staging/rtl8723bs/include/hal_com_phycfg.h
@@ -97,7 +97,7 @@ s8 phy_get_tx_pwr_lmt(struct adapter *adapter, u32 RegPwrTblSel,
 void PHY_SetTxPowerLimit(struct adapter *Adapter, u8 *Regulation, u8 *Bandwidth,
 			 u8 *RateSection, u8 *RfPath, u8 *Channel, u8 *PowerLimit);
 
-void PHY_ConvertTxPowerLimitToPowerIndex(struct adapter *Adapter);
+void phy_tx_power_limit_to_index(struct adapter *Adapter);
 
 void PHY_InitTxPowerLimit(struct adapter *Adapter);
 

-- 
2.47.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/4] staging: rtl8723bs: rename local vars in phy_tx_power_limit_to_index()
  2026-09-27  1:12 [PATCH 0/4] staging: rtl8723bs: refactor PHY_ConvertTxPowerLimitToPowerIndex() Leonardo Martins Martins
  2026-09-27  1:12 ` [PATCH 1/4] staging: rtl8723bs: rename PHY_ConvertTxPowerLimitToPowerIndex() Leonardo Martins Martins
@ 2026-09-27  1:12 ` Leonardo Martins Martins
  2026-10-01  9:31   ` Greg Kroah-Hartman
  2026-09-27  1:12 ` [PATCH 3/4] staging: rtl8723bs: access TxPowerByRateBase2_4G directly Leonardo Martins Martins
  2026-09-27  1:12 ` [PATCH 4/4] staging: rtl8723bs: extract inner loop in phy_tx_power_limit_to_index() Leonardo Martins Martins
  3 siblings, 1 reply; 6+ messages in thread
From: Leonardo Martins Martins @ 2026-09-27  1:12 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-staging, linux-kernel, Leonardo Martins Martins

In phy_tx_power_limit_to_index(), there are many mixed-case names and
needlessly verbose names (such as the iterators, in other realtek
drivers they are shortened like in this patch, by renaming them,
accessing the TxPwrLimit_2_4G table takes less space), rename them.

Signed-off-by: Leonardo Martins Martins <dev.lmmrtns@gmail.com>
---
Renamed Variables:
	pHalData -> hal_data
	Adapter -> adapter
	BW40PwrBasedBm2_4G -> pwr_base
	regulation -> reg
	channel -> ch
	rateSection -> rs
	tempValue -> tmp
	tempPwrLmt -> tmp_pwr_lmt
	rfPath -> path
---
 drivers/staging/rtl8723bs/hal/hal_com_phycfg.c | 48 +++++++++++++-------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
index 1228be0cbc839041384f3e434d22b4f039d69986..6d8e3b26da6d29863bd0f4f43fba6abcdbdf5c9c 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 reg, bw, ch, rs;
+	s8 tmp = 0, tmp_pwr_lmt = 0;
+	u8 path = 0;
 
-	for (regulation = 0; regulation < MAX_REGULATION_NUM; ++regulation) {
+	for (reg = 0; reg < MAX_REGULATION_NUM; ++reg) {
 		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 (ch = 0; ch < CHANNEL_MAX_NUMBER_2G; ++ch) {
+				for (rs = 0; rs < MAX_RATE_SECTION_NUM; ++rs) {
+					tmp_pwr_lmt = hal_data->TxPwrLimit_2_4G[reg][bw][rs][ch][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[reg][bw][rs][ch][path] = tmp;
 						}
 					}
 				}

-- 
2.47.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 3/4] staging: rtl8723bs: access TxPowerByRateBase2_4G directly
  2026-09-27  1:12 [PATCH 0/4] staging: rtl8723bs: refactor PHY_ConvertTxPowerLimitToPowerIndex() Leonardo Martins Martins
  2026-09-27  1:12 ` [PATCH 1/4] staging: rtl8723bs: rename PHY_ConvertTxPowerLimitToPowerIndex() Leonardo Martins Martins
  2026-09-27  1:12 ` [PATCH 2/4] staging: rtl8723bs: rename local vars in phy_tx_power_limit_to_index() Leonardo Martins Martins
@ 2026-09-27  1:12 ` Leonardo Martins Martins
  2026-09-27  1:12 ` [PATCH 4/4] staging: rtl8723bs: extract inner loop in phy_tx_power_limit_to_index() Leonardo Martins Martins
  3 siblings, 0 replies; 6+ messages in thread
From: Leonardo Martins Martins @ 2026-09-27  1:12 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-staging, linux-kernel, Leonardo Martins Martins

In phy_tx_power_limit_to_index(), pwr_base is acquired from
TxPowerByRateBase2_4G using rs, which itself is an iterator between
0 and 2, but it's accessed by using an if-else chain that then passes
the equivalent enum constant to PHY_GetTxPowerByRateBase(), which
checks RfPath against RF_PATH_MAX (which is already done by the loop),
then uses a switch-case statement on the enum to access
TxPowerByRateBase2_4G with the original value of rs.

Remove the redundant if-else, the call to PHY_GetTxPowerByRateBase() and
access it directly. Also remove PHY_GetTxPowerByRateBase() since those
were its only usages.

Signed-off-by: Leonardo Martins Martins <dev.lmmrtns@gmail.com>
---
 drivers/staging/rtl8723bs/hal/hal_com_phycfg.c     | 37 ++--------------------
 drivers/staging/rtl8723bs/include/hal_com_phycfg.h |  3 --
 2 files changed, 3 insertions(+), 37 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
index 6d8e3b26da6d29863bd0f4f43fba6abcdbdf5c9c..46402ab07d757b2aba69d6fb7fec127681c9d012 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
@@ -10,32 +10,6 @@
 #include <linux/kernel.h>
 #include <linux/string.h>
 
-u8 PHY_GetTxPowerByRateBase(struct adapter *Adapter, u8 RfPath,
-			    enum rate_section RateSection)
-{
-	struct hal_com_data	*pHalData = GET_HAL_DATA(Adapter);
-	u8	value = 0;
-
-	if (RfPath >= RF_PATH_MAX)
-		return 0;
-
-	switch (RateSection) {
-	case CCK:
-		value = pHalData->TxPwrByRateBase2_4G[RfPath][0];
-		break;
-	case OFDM:
-		value = pHalData->TxPwrByRateBase2_4G[RfPath][1];
-		break;
-	case HT_MCS0_MCS7:
-		value = pHalData->TxPwrByRateBase2_4G[RfPath][2];
-		break;
-	default:
-		break;
-	}
-
-	return value;
-}
-
 static void
 phy_SetTxPowerByRateBase(struct adapter *Adapter, u8 RfPath,
 			 enum rate_section RateSection, u8 Value)
@@ -755,14 +729,9 @@ void phy_tx_power_limit_to_index(struct adapter *adapter)
 					tmp_pwr_lmt = hal_data->TxPwrLimit_2_4G[reg][bw][rs][ch][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
+						if (hal_data->odmpriv.PhyRegPgValueType == PHY_REG_PG_EXACT_VALUE)
+							pwr_base = hal_data->TxPwrByRateBase2_4G[path][rs];
+						else
 							pwr_base = r->reg_power_base * 2;
 
 						if (tmp_pwr_lmt != MAX_POWER_INDEX) {
diff --git a/drivers/staging/rtl8723bs/include/hal_com_phycfg.h b/drivers/staging/rtl8723bs/include/hal_com_phycfg.h
index a20b4c233de8128fe20e41dee2b303a4662f4de4..ec17e093d8832460ada94878433600063a2b4eab 100644
--- a/drivers/staging/rtl8723bs/include/hal_com_phycfg.h
+++ b/drivers/staging/rtl8723bs/include/hal_com_phycfg.h
@@ -54,9 +54,6 @@ struct bb_register_def {
 
 };
 
-u8 PHY_GetTxPowerByRateBase(struct adapter *Adapter, u8 RfPath,
-			    enum rate_section RateSection);
-
 u8 PHY_GetRateSectionIndexOfTxPowerByRate(struct adapter *padapter, u32	RegAddr,
 					  u32 BitMask);
 

-- 
2.47.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 4/4] staging: rtl8723bs: extract inner loop in phy_tx_power_limit_to_index()
  2026-09-27  1:12 [PATCH 0/4] staging: rtl8723bs: refactor PHY_ConvertTxPowerLimitToPowerIndex() Leonardo Martins Martins
                   ` (2 preceding siblings ...)
  2026-09-27  1:12 ` [PATCH 3/4] staging: rtl8723bs: access TxPowerByRateBase2_4G directly Leonardo Martins Martins
@ 2026-09-27  1:12 ` Leonardo Martins Martins
  3 siblings, 0 replies; 6+ messages in thread
From: Leonardo Martins Martins @ 2026-09-27  1:12 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-staging, linux-kernel, Leonardo Martins Martins

phy_tx_power_limit_to_index() iterates over an array with 5 indexes,
making the code deeply nested, move the inner loop into an auxiliary
static function to reduce nesting and improve readability.

Signed-off-by: Leonardo Martins Martins <dev.lmmrtns@gmail.com>
---
 drivers/staging/rtl8723bs/hal/hal_com_phycfg.c | 47 ++++++++++++++------------
 1 file changed, 25 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
index 46402ab07d757b2aba69d6fb7fec127681c9d012..8e39419b95f445f0eb153efcd28dd97fafeb8e03 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
@@ -713,35 +713,38 @@ s8 phy_get_tx_pwr_lmt(struct adapter *adapter, u32 reg_pwr_tbl_sel,
 	return pwr_lmt;
 }
 
+static void __phy_tx_power_limit_to_index(struct hal_com_data *hal_data, struct registry_priv *r,
+					  u8 reg, u8 bw, u8 ch, u8 rs)
+{
+	s8 tmp_pwr_lmt = hal_data->TxPwrLimit_2_4G[reg][bw][rs][ch][RF_PATH_A];
+	s8 tmp;
+	u8 path;
+	u8 pwr_base;
+
+	for (path = RF_PATH_A; path < MAX_RF_PATH_NUM; ++path) {
+		if (hal_data->odmpriv.PhyRegPgValueType == PHY_REG_PG_EXACT_VALUE)
+			pwr_base = hal_data->TxPwrByRateBase2_4G[path][rs];
+		else
+			pwr_base = r->reg_power_base * 2;
+
+		if (tmp_pwr_lmt != MAX_POWER_INDEX) {
+			tmp = tmp_pwr_lmt - pwr_base;
+			hal_data->TxPwrLimit_2_4G[reg][bw][rs][ch][path] = tmp;
+		}
+	}
+}
+
 void phy_tx_power_limit_to_index(struct adapter *adapter)
 {
 	struct hal_com_data *hal_data = GET_HAL_DATA(adapter);
 	struct registry_priv *r = &adapter->registrypriv;
-	u8 pwr_base = 0x2E;
 	u8 reg, bw, ch, rs;
-	s8 tmp = 0, tmp_pwr_lmt = 0;
-	u8 path = 0;
 
 	for (reg = 0; reg < MAX_REGULATION_NUM; ++reg) {
-		for (bw = 0; bw < MAX_2_4G_BANDWIDTH_NUM; ++bw) {
-			for (ch = 0; ch < CHANNEL_MAX_NUMBER_2G; ++ch) {
-				for (rs = 0; rs < MAX_RATE_SECTION_NUM; ++rs) {
-					tmp_pwr_lmt = hal_data->TxPwrLimit_2_4G[reg][bw][rs][ch][RF_PATH_A];
-
-					for (path = RF_PATH_A; path < MAX_RF_PATH_NUM; ++path) {
-						if (hal_data->odmpriv.PhyRegPgValueType == PHY_REG_PG_EXACT_VALUE)
-							pwr_base = hal_data->TxPwrByRateBase2_4G[path][rs];
-						else
-							pwr_base = r->reg_power_base * 2;
-
-						if (tmp_pwr_lmt != MAX_POWER_INDEX) {
-							tmp = tmp_pwr_lmt - pwr_base;
-							hal_data->TxPwrLimit_2_4G[reg][bw][rs][ch][path] = tmp;
-						}
-					}
-				}
-			}
-		}
+		for (bw = 0; bw < MAX_2_4G_BANDWIDTH_NUM; ++bw)
+			for (ch = 0; ch < CHANNEL_MAX_NUMBER_2G; ++ch)
+				for (rs = 0; rs < MAX_RATE_SECTION_NUM; ++rs)
+					__phy_tx_power_limit_to_index(hal_data, r, reg, bw, ch, rs);
 	}
 }
 

-- 
2.47.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/4] staging: rtl8723bs: rename local vars in phy_tx_power_limit_to_index()
  2026-09-27  1:12 ` [PATCH 2/4] staging: rtl8723bs: rename local vars in phy_tx_power_limit_to_index() Leonardo Martins Martins
@ 2026-10-01  9:31   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-01  9:31 UTC (permalink / raw)
  To: Leonardo Martins Martins; +Cc: linux-staging, linux-kernel

On Sat, Sep 26, 2026 at 10:12:25PM -0300, Leonardo Martins Martins wrote:
> In phy_tx_power_limit_to_index(), there are many mixed-case names and
> needlessly verbose names (such as the iterators, in other realtek
> drivers they are shortened like in this patch, by renaming them,
> accessing the TxPwrLimit_2_4G table takes less space), rename them.
> 
> Signed-off-by: Leonardo Martins Martins <dev.lmmrtns@gmail.com>
> ---
> Renamed Variables:
> 	pHalData -> hal_data
> 	Adapter -> adapter
> 	BW40PwrBasedBm2_4G -> pwr_base
> 	regulation -> reg

This is ok, as is:

> 	channel -> ch

and there is nothing wrong with "channel", please keep both of these.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-10-01  9:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-27  1:12 [PATCH 0/4] staging: rtl8723bs: refactor PHY_ConvertTxPowerLimitToPowerIndex() Leonardo Martins Martins
2026-09-27  1:12 ` [PATCH 1/4] staging: rtl8723bs: rename PHY_ConvertTxPowerLimitToPowerIndex() Leonardo Martins Martins
2026-09-27  1:12 ` [PATCH 2/4] staging: rtl8723bs: rename local vars in phy_tx_power_limit_to_index() Leonardo Martins Martins
2026-10-01  9:31   ` Greg Kroah-Hartman
2026-09-27  1:12 ` [PATCH 3/4] staging: rtl8723bs: access TxPowerByRateBase2_4G directly Leonardo Martins Martins
2026-09-27  1:12 ` [PATCH 4/4] staging: rtl8723bs: extract inner loop in phy_tx_power_limit_to_index() Leonardo Martins Martins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®