From: Nikolay Kulikov <nikolayof23@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-staging@lists.linux.dev, Nikolay Kulikov <nikolayof23@gmail.com>
Subject: [PATCH 2/2] staging: rtl8723bs: remove local variable 'eRFPath'
Date: Sun, 21 Jun 2026 19:12:29 +0300 [thread overview]
Message-ID: <20260621161611.111461-3-nikolayof23@gmail.com> (raw)
In-Reply-To: <20260621161611.111461-1-nikolayof23@gmail.com>
After removing the loop from the phy_RF6052_Config_ParaFile() function,
the value of this variable can no longer be changed, allowing all
switch-case statements to be known in advance, since it stores the value
0 (which is 'RF_PATH_A', defined in enum rf_path).
Therefore, remove it and the associated dead code and access 'RF_PATH_A'
directly.
Signed-off-by: Nikolay Kulikov <nikolayof23@gmail.com>
---
.../staging/rtl8723bs/hal/rtl8723b_rf6052.c | 29 +++----------------
1 file changed, 4 insertions(+), 25 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_rf6052.c b/drivers/staging/rtl8723bs/hal/rtl8723b_rf6052.c
index 86759516838b..fac1270853de 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_rf6052.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_rf6052.c
@@ -81,7 +81,6 @@ void PHY_RF6052SetBandwidth8723B(
static int phy_RF6052_Config_ParaFile(struct adapter *Adapter)
{
u32 u4RegValue = 0;
- u8 eRFPath = 0;
struct bb_register_def *pPhyReg;
struct hal_com_data *pHalData = GET_HAL_DATA(Adapter);
@@ -89,17 +88,10 @@ static int phy_RF6052_Config_ParaFile(struct adapter *Adapter)
/* 3 <2> Initialize RF */
/* 3----------------------------------------------------------------- */
- pPhyReg = &pHalData->PHYRegDef[eRFPath];
+ pPhyReg = &pHalData->PHYRegDef[RF_PATH_A];
/*----Store original RFENV control type----*/
- switch (eRFPath) {
- case RF_PATH_A:
- u4RegValue = PHY_QueryBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV);
- break;
- case RF_PATH_B:
- u4RegValue = PHY_QueryBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV << 16);
- break;
- }
+ u4RegValue = PHY_QueryBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV);
/*----Set RF_ENV enable----*/
PHY_SetBBReg(Adapter, pPhyReg->rfintfe, bRFSI_RFENV << 16, 0x1);
@@ -117,23 +109,10 @@ static int phy_RF6052_Config_ParaFile(struct adapter *Adapter)
udelay(1);/* PlatformStallExecution(1); */
/*----Initialize RF fom connfiguration file----*/
- switch (eRFPath) {
- case RF_PATH_A:
- case RF_PATH_B:
- ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv,
- CONFIG_RF_RADIO, eRFPath);
- break;
- }
+ ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv, CONFIG_RF_RADIO, RF_PATH_A);
/*----Restore RFENV control type----*/
- switch (eRFPath) {
- case RF_PATH_A:
- PHY_SetBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV, u4RegValue);
- break;
- case RF_PATH_B:
- PHY_SetBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV << 16, u4RegValue);
- break;
- }
+ PHY_SetBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV, u4RegValue);
/* 3 ----------------------------------------------------------------- */
/* 3 Configuration of Tx Power Tracking */
--
2.54.0
prev parent reply other threads:[~2026-06-21 16:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-21 16:12 [PATCH 0/2] staging: rtl8723bs: simplify the phy_RF6052_Config_ParaFile() function Nikolay Kulikov
2026-06-21 16:12 ` [PATCH 1/2] staging: rtl8723bs: remove 'NumTotalRFPath' from 'struct hal_com_data' Nikolay Kulikov
2026-06-21 16:12 ` Nikolay Kulikov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260621161611.111461-3-nikolayof23@gmail.com \
--to=nikolayof23@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-staging@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox