linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8723au: hal: HalDMOutSrc8723A_CE: Removed variables that is never used
@ 2015-01-31 15:08 Rickard Strandqvist
  2015-02-01 23:00 ` Jes Sorensen
  0 siblings, 1 reply; 3+ messages in thread
From: Rickard Strandqvist @ 2015-01-31 15:08 UTC (permalink / raw)
  To: Larry Finger, Jes Sorensen
  Cc: Rickard Strandqvist, Greg Kroah-Hartman, Roberta Dobrescu,
	linux-wireless, devel, linux-kernel

Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/staging/rtl8723au/hal/HalDMOutSrc8723A_CE.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/HalDMOutSrc8723A_CE.c b/drivers/staging/rtl8723au/hal/HalDMOutSrc8723A_CE.c
index 179a1ba..3cbbfb7 100644
--- a/drivers/staging/rtl8723au/hal/HalDMOutSrc8723A_CE.c
+++ b/drivers/staging/rtl8723au/hal/HalDMOutSrc8723A_CE.c
@@ -743,10 +743,8 @@ static void _PHY_IQCalibrate(struct rtw_adapter *pAdapter, int result[][8], u8 t
 	/*  Note: IQ calibration must be performed after loading  */
 	/*		PHY_REG.txt , and radio_a, radio_b.txt	 */
 
-	u32 bbvalue;
-
 	if (t == 0) {
-		bbvalue = PHY_QueryBBReg(pAdapter, rFPGA0_RFMOD, bMaskDWord);
+		PHY_QueryBBReg(pAdapter, rFPGA0_RFMOD, bMaskDWord);
 
 		/*  Save ADDA parameters, turn Path A ADDA on */
 		_PHY_SaveADDARegisters(pAdapter, ADDA_REG, pdmpriv->ADDA_backup, IQK_ADDA_REG_NUM);
@@ -1047,7 +1045,7 @@ void rtl8723a_phy_iq_calibrate(struct rtw_adapter *pAdapter, bool bReCovery)
 		bPathAOK = bPathBOK = true;
 	} else {
 		RegE94 = RegEB4 = pdmpriv->RegE94 = pdmpriv->RegEB4 = 0x100;	/* X default value */
-		RegE9C = RegEBC = pdmpriv->RegE9C = pdmpriv->RegEBC = 0x0;		/* Y default value */
+		pdmpriv->RegE9C = pdmpriv->RegEBC = 0x0;		/* Y default value */
 	}
 
 	if ((RegE94 != 0)/*&&(RegEA4 != 0)*/)
-- 
1.7.10.4


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

* Re: [PATCH] staging: rtl8723au: hal: HalDMOutSrc8723A_CE: Removed variables that is never used
  2015-01-31 15:08 [PATCH] staging: rtl8723au: hal: HalDMOutSrc8723A_CE: Removed variables that is never used Rickard Strandqvist
@ 2015-02-01 23:00 ` Jes Sorensen
  2015-02-01 23:17   ` Rickard Strandqvist
  0 siblings, 1 reply; 3+ messages in thread
From: Jes Sorensen @ 2015-02-01 23:00 UTC (permalink / raw)
  To: Rickard Strandqvist
  Cc: Larry Finger, Greg Kroah-Hartman, Roberta Dobrescu,
	linux-wireless, devel, linux-kernel

Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> writes:
> Variable was assigned a value that was never used.
> I have also removed all the code that thereby serves no purpose.
>
> This was found using a static code analysis program called cppcheck
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
>  drivers/staging/rtl8723au/hal/HalDMOutSrc8723A_CE.c |    6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/rtl8723au/hal/HalDMOutSrc8723A_CE.c b/drivers/staging/rtl8723au/hal/HalDMOutSrc8723A_CE.c
> index 179a1ba..3cbbfb7 100644
> --- a/drivers/staging/rtl8723au/hal/HalDMOutSrc8723A_CE.c
> +++ b/drivers/staging/rtl8723au/hal/HalDMOutSrc8723A_CE.c
> @@ -743,10 +743,8 @@ static void _PHY_IQCalibrate(struct rtw_adapter *pAdapter, int result[][8], u8 t
>  	/*  Note: IQ calibration must be performed after loading  */
>  	/*		PHY_REG.txt , and radio_a, radio_b.txt	 */
>  
> -	u32 bbvalue;
> -
>  	if (t == 0) {
> -		bbvalue = PHY_QueryBBReg(pAdapter, rFPGA0_RFMOD, bMaskDWord);
> +		PHY_QueryBBReg(pAdapter, rFPGA0_RFMOD, bMaskDWord);

In this particular case, I'd say to get rid of the call completely.
FPGA0_RFMOD should not have magic side effects just from being read.

Jes

>  
>  		/*  Save ADDA parameters, turn Path A ADDA on */
>  		_PHY_SaveADDARegisters(pAdapter, ADDA_REG, pdmpriv->ADDA_backup, IQK_ADDA_REG_NUM);
> @@ -1047,7 +1045,7 @@ void rtl8723a_phy_iq_calibrate(struct rtw_adapter *pAdapter, bool bReCovery)
>  		bPathAOK = bPathBOK = true;
>  	} else {
>  		RegE94 = RegEB4 = pdmpriv->RegE94 = pdmpriv->RegEB4 = 0x100;	/* X default value */
> -		RegE9C = RegEBC = pdmpriv->RegE9C = pdmpriv->RegEBC = 0x0;		/* Y default value */
> +		pdmpriv->RegE9C = pdmpriv->RegEBC = 0x0;		/* Y default value */
>  	}
>  
>  	if ((RegE94 != 0)/*&&(RegEA4 != 0)*/)

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

* Re: [PATCH] staging: rtl8723au: hal: HalDMOutSrc8723A_CE: Removed variables that is never used
  2015-02-01 23:00 ` Jes Sorensen
@ 2015-02-01 23:17   ` Rickard Strandqvist
  0 siblings, 0 replies; 3+ messages in thread
From: Rickard Strandqvist @ 2015-02-01 23:17 UTC (permalink / raw)
  To: Jes Sorensen
  Cc: Larry Finger, Greg Kroah-Hartman, Roberta Dobrescu,
	linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org,
	Linux Kernel Mailing List

2015-02-02 0:00 GMT+01:00 Jes Sorensen <Jes.Sorensen@redhat.com>:
> Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> writes:
>> Variable was assigned a value that was never used.
>> I have also removed all the code that thereby serves no purpose.
>>
>> This was found using a static code analysis program called cppcheck
>>
>> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
>> ---
>>  drivers/staging/rtl8723au/hal/HalDMOutSrc8723A_CE.c |    6 ++----
>>  1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/staging/rtl8723au/hal/HalDMOutSrc8723A_CE.c b/drivers/staging/rtl8723au/hal/HalDMOutSrc8723A_CE.c
>> index 179a1ba..3cbbfb7 100644
>> --- a/drivers/staging/rtl8723au/hal/HalDMOutSrc8723A_CE.c
>> +++ b/drivers/staging/rtl8723au/hal/HalDMOutSrc8723A_CE.c
>> @@ -743,10 +743,8 @@ static void _PHY_IQCalibrate(struct rtw_adapter *pAdapter, int result[][8], u8 t
>>       /*  Note: IQ calibration must be performed after loading  */
>>       /*              PHY_REG.txt , and radio_a, radio_b.txt   */
>>
>> -     u32 bbvalue;
>> -
>>       if (t == 0) {
>> -             bbvalue = PHY_QueryBBReg(pAdapter, rFPGA0_RFMOD, bMaskDWord);
>> +             PHY_QueryBBReg(pAdapter, rFPGA0_RFMOD, bMaskDWord);
>
> In this particular case, I'd say to get rid of the call completely.
> FPGA0_RFMOD should not have magic side effects just from being read.
>
> Jes
>
>>
>>               /*  Save ADDA parameters, turn Path A ADDA on */
>>               _PHY_SaveADDARegisters(pAdapter, ADDA_REG, pdmpriv->ADDA_backup, IQK_ADDA_REG_NUM);
>> @@ -1047,7 +1045,7 @@ void rtl8723a_phy_iq_calibrate(struct rtw_adapter *pAdapter, bool bReCovery)
>>               bPathAOK = bPathBOK = true;
>>       } else {
>>               RegE94 = RegEB4 = pdmpriv->RegE94 = pdmpriv->RegEB4 = 0x100;    /* X default value */
>> -             RegE9C = RegEBC = pdmpriv->RegE9C = pdmpriv->RegEBC = 0x0;              /* Y default value */
>> +             pdmpriv->RegE9C = pdmpriv->RegEBC = 0x0;                /* Y default value */
>>       }
>>
>>       if ((RegE94 != 0)/*&&(RegEA4 != 0)*/)



Hi

I am sorry, please ignore this.
I will not send any more patches.

Kind regards
Rickard Strandqvist

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

end of thread, other threads:[~2015-02-01 23:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-31 15:08 [PATCH] staging: rtl8723au: hal: HalDMOutSrc8723A_CE: Removed variables that is never used Rickard Strandqvist
2015-02-01 23:00 ` Jes Sorensen
2015-02-01 23:17   ` Rickard Strandqvist

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).