[PATCH v2] staging: rtl8723bs: remove shadowed variable in sdio_halinit

Haroen Tmimi posted 1 patch 3 hours ago
There is a newer version of this series
drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c | 1 -
drivers/staging/rtl8723bs/hal/sdio_halinit.c   | 2 +-
2 files changed, 1 insertion(+), 2 deletions(-)
[PATCH v2] staging: rtl8723bs: remove shadowed variable in sdio_halinit
Posted by Haroen Tmimi 3 hours ago
The variable 'bMacPwrCtrlOn' was redeclared in the function
CardEnable, shadowing a variable of the same name declared at the
top of the function (line 21).

Remove the redundant 'u8' type declaration to use the existing outer
variable and resolve a -Wshadow warning.

Signed-off-by: Haroen Tmimi <tmimiharoen@gmail.com>
---
Changes in v2:
Removed incorrect blank line after the opening brace that was left
behind when removing the Adapter variable.

 drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c | 1 -
 drivers/staging/rtl8723bs/hal/sdio_halinit.c   | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
index f712d0345b99..0f915589b518 100644
--- a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
+++ b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
@@ -208,7 +208,6 @@ void ODM_TxPwrTrackSetPwr_8723B(
 	}
 
 	if (Method == TXAGC) {
-
 		pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = pDM_Odm->Absolute_OFDMSwingIdx[RFPath];
 
 		pDM_Odm->Modify_TxAGC_Flag_PathA = true;
diff --git a/drivers/staging/rtl8723bs/hal/sdio_halinit.c b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
index 0fa1b22fdf9a..861d5162de15 100644
--- a/drivers/staging/rtl8723bs/hal/sdio_halinit.c
+++ b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
@@ -30,7 +30,7 @@ static u8 CardEnable(struct adapter *padapter)
 
 		ret = HalPwrSeqCmdParsing(padapter, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, rtl8723B_card_enable_flow);
 		if (ret == _SUCCESS) {
-			u8 bMacPwrCtrlOn = true;
+			bMacPwrCtrlOn = true;
 			rtw_hal_set_hwreg(padapter, HW_VAR_APFM_ON_MAC, &bMacPwrCtrlOn);
 		}
 	} else
-- 
2.53.0
Re: [PATCH v2] staging: rtl8723bs: remove shadowed variable in sdio_halinit
Posted by Ethan Tidmore 2 hours ago
On Tue Feb 10, 2026 at 11:04 AM CST, Haroen Tmimi wrote:
> The variable 'bMacPwrCtrlOn' was redeclared in the function
> CardEnable, shadowing a variable of the same name declared at the
> top of the function (line 21).
>
> Remove the redundant 'u8' type declaration to use the existing outer
> variable and resolve a -Wshadow warning.
>
> Signed-off-by: Haroen Tmimi <tmimiharoen@gmail.com>
> ---
> Changes in v2:
> Removed incorrect blank line after the opening brace that was left
> behind when removing the Adapter variable.
>
>  drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c | 1 -
>  drivers/staging/rtl8723bs/hal/sdio_halinit.c   | 2 +-
>  2 files changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
> index f712d0345b99..0f915589b518 100644
> --- a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
> +++ b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
> @@ -208,7 +208,6 @@ void ODM_TxPwrTrackSetPwr_8723B(
>  	}
>  
>  	if (Method == TXAGC) {
> -
>  		pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = pDM_Odm->Absolute_OFDMSwingIdx[RFPath];
>  
>  		pDM_Odm->Modify_TxAGC_Flag_PathA = true;

It looks like you accidently left your previous diff in this patch.

Thanks,

ET