[PATCH] staging: rtl8723bs: remove redundant 'Adapter' variable in HalPhyRf_8723B

Haroen Tmimi posted 1 patch 5 hours ago
There is a newer version of this series
drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c | 1 -
1 file changed, 1 deletion(-)
[PATCH] staging: rtl8723bs: remove redundant 'Adapter' variable in HalPhyRf_8723B
Posted by Haroen Tmimi 5 hours ago
The variable Adapter was declared and initialized locally in
an if-statement, but it shadowed a variable of the same name and
value declared in the function scope (line 169).

Removing the inner declaration allows the code to use the existing
outer variable, resolving a -Wshadow warning.

Signed-off-by: Haroen Tmimi <tmimiharoen@gmail.com>
---
 drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
index 9df3274c1048..f712d0345b99 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) {
-		struct adapter *Adapter = pDM_Odm->Adapter;
 
 		pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = pDM_Odm->Absolute_OFDMSwingIdx[RFPath];
 
-- 
2.53.0
Re: [PATCH] staging: rtl8723bs: remove redundant 'Adapter' variable in HalPhyRf_8723B
Posted by Greg KH 5 hours ago
On Tue, Feb 10, 2026 at 05:32:36PM +0100, Haroen Tmimi wrote:
> The variable Adapter was declared and initialized locally in
> an if-statement, but it shadowed a variable of the same name and
> value declared in the function scope (line 169).
> 
> Removing the inner declaration allows the code to use the existing
> outer variable, resolving a -Wshadow warning.
> 
> Signed-off-by: Haroen Tmimi <tmimiharoen@gmail.com>
> ---
>  drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
> index 9df3274c1048..f712d0345b99 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) {
> -		struct adapter *Adapter = pDM_Odm->Adapter;
>  
>  		pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = pDM_Odm->Absolute_OFDMSwingIdx[RFPath];
>  
> -- 
> 2.53.0
> 

And now you have another coding style warning :(

Please be more careful when doing code cleanups so as to not add
additional problems.

thanks,

greg k-h
Re: [PATCH] staging: rtl8723bs: remove redundant 'Adapter' variable in HalPhyRf_8723B
Posted by Haroen Tmimi 5 hours ago
My apologies, I should have been more careful before sending the patch.

With kind regards,

Haroen Tmimi

Op di 10 feb 2026 om 17:35 schreef Greg KH <gregkh@linuxfoundation.org>:
>
> On Tue, Feb 10, 2026 at 05:32:36PM +0100, Haroen Tmimi wrote:
> > The variable Adapter was declared and initialized locally in
> > an if-statement, but it shadowed a variable of the same name and
> > value declared in the function scope (line 169).
> >
> > Removing the inner declaration allows the code to use the existing
> > outer variable, resolving a -Wshadow warning.
> >
> > Signed-off-by: Haroen Tmimi <tmimiharoen@gmail.com>
> > ---
> >  drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c | 1 -
> >  1 file changed, 1 deletion(-)
> >
> > diff --git a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
> > index 9df3274c1048..f712d0345b99 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) {
> > -             struct adapter *Adapter = pDM_Odm->Adapter;
> >
> >               pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = pDM_Odm->Absolute_OFDMSwingIdx[RFPath];
> >
> > --
> > 2.53.0
> >
>
> And now you have another coding style warning :(
>
> Please be more careful when doing code cleanups so as to not add
> additional problems.
>
> thanks,
>
> greg k-h