* [PATCH] Staging: rtl8188eu: Remove unnecessary variable
@ 2015-02-23 8:50 Vatika Harlalka
0 siblings, 0 replies; 5+ 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] 5+ messages in thread
* [PATCH] Staging: rtl8188eu: Remove unnecessary variable
@ 2015-02-23 9:16 Vatika Harlalka
2015-02-23 9:29 ` [Outreachy kernel] " Daniel Baluta
0 siblings, 1 reply; 5+ 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] 5+ messages in thread
* Re: [Outreachy kernel] [PATCH] Staging: rtl8188eu: Remove unnecessary variable
2015-02-23 9:16 [PATCH] Staging: rtl8188eu: Remove unnecessary variable Vatika Harlalka
@ 2015-02-23 9:29 ` Daniel Baluta
2015-02-23 9:41 ` Julia Lawall
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Baluta @ 2015-02-23 9:29 UTC (permalink / raw)
To: Vatika Harlalka; +Cc: outreachy-kernel
On Mon, Feb 23, 2015 at 11:16 AM, Vatika Harlalka
<vatikaharlalka@gmail.com> wrote:
> Remove unnecessary variable and replace its uses with previously
> defined variable.
Hi Vatika,
A good commit message should always try to explain why the change is needed.
In this case you could say:
We only need the last 8 bits from offset, so we can directly operate
on offset variable
instead of introducing unneeded newoffset.
Other than that the code looks good to me.
Thanks,
Daniel.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Outreachy kernel] [PATCH] Staging: rtl8188eu: Remove unnecessary variable
2015-02-23 9:29 ` [Outreachy kernel] " Daniel Baluta
@ 2015-02-23 9:41 ` Julia Lawall
2015-02-23 9:44 ` Daniel Baluta
0 siblings, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2015-02-23 9:41 UTC (permalink / raw)
To: Daniel Baluta; +Cc: Vatika Harlalka, outreachy-kernel
On Mon, 23 Feb 2015, Daniel Baluta wrote:
> On Mon, Feb 23, 2015 at 11:16 AM, Vatika Harlalka
> <vatikaharlalka@gmail.com> wrote:
> > Remove unnecessary variable and replace its uses with previously
> > defined variable.
>
> Hi Vatika,
>
> A good commit message should always try to explain why the change is needed.
> In this case you could say:
>
> We only need the last 8 bits from offset, so we can directly operate
> on offset variable
> instead of introducing unneeded newoffset.
How is the number of bits used relevant? They are both u32 variables.
thanks,
julia
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Outreachy kernel] [PATCH] Staging: rtl8188eu: Remove unnecessary variable
2015-02-23 9:41 ` Julia Lawall
@ 2015-02-23 9:44 ` Daniel Baluta
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Baluta @ 2015-02-23 9:44 UTC (permalink / raw)
To: Julia Lawall; +Cc: Daniel Baluta, Vatika Harlalka, outreachy-kernel
On Mon, Feb 23, 2015 at 11:41 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> On Mon, 23 Feb 2015, Daniel Baluta wrote:
>
>> On Mon, Feb 23, 2015 at 11:16 AM, Vatika Harlalka
>> <vatikaharlalka@gmail.com> wrote:
>> > Remove unnecessary variable and replace its uses with previously
>> > defined variable.
>>
>> Hi Vatika,
>>
>> A good commit message should always try to explain why the change is needed.
>> In this case you could say:
>>
>> We only need the last 8 bits from offset, so we can directly operate
>> on offset variable
>> instead of introducing unneeded newoffset.
>
> How is the number of bits used relevant? They are both u32 variables.
Used as in useful.
Doing:
newoffset = offset & 0xff;
we only care about last 8 bits of offset.
Daniel.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-02-23 9:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-23 9:16 [PATCH] Staging: rtl8188eu: Remove unnecessary variable Vatika Harlalka
2015-02-23 9:29 ` [Outreachy kernel] " Daniel Baluta
2015-02-23 9:41 ` Julia Lawall
2015-02-23 9:44 ` Daniel Baluta
-- strict thread matches above, loose matches on Subject: below --
2015-02-23 8:50 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.