[PATCH 49/61] staging: rtl8723bs: remove phy_GetChannelIndexOfTxPowerLimit helper

From: Arsenii Pashchenko

Date: Wed Jul 15 2026 - 09:11:16 EST


Remove the tiny single-line helper function
phy_GetChannelIndexOfTxPowerLimit. Inline the arithmetic index
calculation directly into the callers to simplify the code and
reduce runtime call overhead.

Signed-off-by: Arsenii Pashchenko <ulijg308@xxxxxxxxx>
---
drivers/staging/rtl8723bs/hal/hal_com_phycfg.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
index 32b69ba3b..7ad04aa85 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
@@ -643,10 +643,7 @@ static s8 phy_GetWorldWideLimit(s8 *LimitTable)
return min;
}

-static s8 phy_GetChannelIndexOfTxPowerLimit(u8 Channel)
-{
- return Channel - 1;
-}
+

static s16 get_bandwidth_idx(const enum channel_width bandwidth)
{
@@ -721,7 +718,7 @@ s8 phy_get_tx_pwr_lmt(struct adapter *adapter, u32 reg_pwr_tbl_sel,
if (idx_rate_sctn == 0 || idx_rate_sctn == 1)
idx_bandwidth = 0;

- channel = phy_GetChannelIndexOfTxPowerLimit(channel);
+ channel--;

if (idx_regulation == -1 || idx_bandwidth == -1 ||
idx_rate_sctn == -1 || idx_channel == -1)
@@ -838,7 +835,7 @@ void PHY_SetTxPowerLimit(
else if (strcmp(Bandwidth, "40M") == 0)
bandwidth = 1;

- channelIndex = phy_GetChannelIndexOfTxPowerLimit(channel);
+ channelIndex = channel-1;

if (channelIndex == -1)
return;
--
2.55.0