Staging: rtl8188eu: Remove unnecessary variable
PATCH 1/1 Staging: rtl8188eu: Remove unnecessary variable
Remove unnecessary variable and replace its uses with previously defined variable.
--- drivers/staging/rtl8188eu/hal/phy.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/staging/rtl8188eu/hal/phy.c +2 -3
@@ -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); }
Signature · 1 line
1.9.1
Quoted 2 lines · Vatika Harlalka
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.
Quoted 5 lines · Daniel Baluta
Quoted 2 lines · Vatika Harlalka
Remove unnecessary variable and replace its uses with previously defined variable.
Quoted 8 lines
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
Quoted 9 lines · Julia Lawall
Quoted 7 lines · Daniel Baluta
Quoted 2 lines · Vatika Harlalka
Remove unnecessary variable and replace its uses with previously defined variable.
Hi Vatika,
Quoted 8 lines
Quoted 6 lines
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.