All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: rtl8188eu: Remove unnecessary variable
@ 2015-02-23  8:50 Vatika Harlalka
  2015-02-23  9:06 ` [Outreachy kernel] " Julia Lawall
  0 siblings, 1 reply; 3+ messages in thread
From: Vatika Harlalka @ 2015-02-23  8:50 UTC (permalink / raw)
  To: outreachy-kernel

Remove unneccessary variable and replace its uses with another
variable which is previously defined.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
---
 drivers/staging/rtl8188eu/hal/phy.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
index 3f663fe..3950cb3 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -72,12 +72,10 @@ static u32 rf_serial_read(struct adapter *adapt,
 	u32 ret = 0;
 	struct hal_data_8188e *hal_data = GET_HAL_DATA(adapt);
 	struct bb_reg_def *phyreg = &hal_data->PHYRegDef[rfpath];
-	u32 newoffset;
 	u32 tmplong, tmplong2;
 	u8 rfpi_enable = 0;
 
 	offset &= 0xff;
-	newoffset = offset;
 
 	tmplong = phy_query_bb_reg(adapt, rFPGA0_XA_HSSIParameter2, bMaskDWord);
 	if (rfpath == RF_PATH_A)
@@ -87,7 +85,7 @@ static u32 rf_serial_read(struct adapter *adapt,
 					    bMaskDWord);
 
 	tmplong2 = (tmplong2 & (~bLSSIReadAddress)) |
-		   (newoffset<<23) | bLSSIReadEdge;
+		   (offset<<23) | bLSSIReadEdge;
 
 	phy_set_bb_reg(adapt, rFPGA0_XA_HSSIParameter2, bMaskDWord,
 		       tmplong&(~bLSSIReadEdge));
-- 
1.9.1



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

* Re: [Outreachy kernel] [PATCH] Staging: rtl8188eu: Remove unnecessary variable
  2015-02-23  8:50 [PATCH] Staging: rtl8188eu: Remove unnecessary variable Vatika Harlalka
@ 2015-02-23  9:06 ` Julia Lawall
  0 siblings, 0 replies; 3+ messages in thread
From: Julia Lawall @ 2015-02-23  9:06 UTC (permalink / raw)
  To: Vatika Harlalka; +Cc: outreachy-kernel

On Mon, 23 Feb 2015, Vatika Harlalka wrote:

> Remove unneccessary variable and replace its uses with another
> variable which is previously defined.

The code is a bit strange.  You could consider making the same change in
the write function.

julia

> Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
> ---
>  drivers/staging/rtl8188eu/hal/phy.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
> index 3f663fe..3950cb3 100644
> --- a/drivers/staging/rtl8188eu/hal/phy.c
> +++ b/drivers/staging/rtl8188eu/hal/phy.c
> @@ -72,12 +72,10 @@ static u32 rf_serial_read(struct adapter *adapt,
>  	u32 ret = 0;
>  	struct hal_data_8188e *hal_data = GET_HAL_DATA(adapt);
>  	struct bb_reg_def *phyreg = &hal_data->PHYRegDef[rfpath];
> -	u32 newoffset;
>  	u32 tmplong, tmplong2;
>  	u8 rfpi_enable = 0;
>
>  	offset &= 0xff;
> -	newoffset = offset;
>
>  	tmplong = phy_query_bb_reg(adapt, rFPGA0_XA_HSSIParameter2, bMaskDWord);
>  	if (rfpath == RF_PATH_A)
> @@ -87,7 +85,7 @@ static u32 rf_serial_read(struct adapter *adapt,
>  					    bMaskDWord);
>
>  	tmplong2 = (tmplong2 & (~bLSSIReadAddress)) |
> -		   (newoffset<<23) | bLSSIReadEdge;
> +		   (offset<<23) | bLSSIReadEdge;
>
>  	phy_set_bb_reg(adapt, rFPGA0_XA_HSSIParameter2, bMaskDWord,
>  		       tmplong&(~bLSSIReadEdge));
> --
> 1.9.1
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20150223085030.GA1602%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>


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

* [PATCH] Staging: rtl8188eu: Remove unnecessary variable
@ 2015-02-23  9:16 Vatika Harlalka
  0 siblings, 0 replies; 3+ messages in thread
From: Vatika Harlalka @ 2015-02-23  9:16 UTC (permalink / raw)
  To: outreachy-kernel

Remove unnecessary variable and replace its uses with previously
defined variable.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
---
 drivers/staging/rtl8188eu/hal/phy.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
index 623fb4f..341f0db 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -117,10 +117,9 @@ static void rf_serial_write(struct adapter *adapt,
 	u32 data_and_addr = 0;
 	struct hal_data_8188e *hal_data = GET_HAL_DATA(adapt);
 	struct bb_reg_def *phyreg = &hal_data->PHYRegDef[rfpath];
-	u32 newoffset;
 
-	newoffset = offset & 0xff;
-	data_and_addr = ((newoffset<<20) | (data&0x000fffff)) & 0x0fffffff;
+	offset &= 0xff;
+	data_and_addr = ((offset<<20) | (data&0x000fffff)) & 0x0fffffff;
 	phy_set_bb_reg(adapt, phyreg->rf3wireOffset, bMaskDWord, data_and_addr);
 }
 
-- 
1.9.1



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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-23  8:50 [PATCH] Staging: rtl8188eu: Remove unnecessary variable Vatika Harlalka
2015-02-23  9:06 ` [Outreachy kernel] " Julia Lawall
  -- strict thread matches above, loose matches on Subject: below --
2015-02-23  9:16 Vatika Harlalka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.