Staging: rtl8188eu: Refine if condition
PATCH 1/1 Staging: rtl8188eu: Refine if condition
Variable bound takes maximum value 8 so the if condition for odd i is made more compact.
--- drivers/staging/rtl8188eu/hal/phy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8188eu/hal/phy.c +1 -1
@@ -1038,7 +1038,7 @@ static bool simularity_compare(struct adapter *adapt, s32 resulta[][8], bound =4 ;for (i =0 ; i < bound; i++) { -if ((i ==1 ) || (i ==3 ) || (i ==5 ) || (i ==7 )) { +if (i%2 ==1 ) {if ((resulta[c1][i] &0x00000200 ) !=0 ) tmp1 = resulta[c1][i] |0xFFFFFC00 ;else
Signature · 1 line
1.9.1
Greg KH
maintainerQuoted 13 lines · Vatika Harlalka
Variable bound takes maximum value 8 so the if condition for odd i is made more compact.
Signed-off-by Vatika Harlalka <[email protected]>--- drivers/staging/rtl8188eu/hal/phy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/rtl8188eu/hal/phy.c +0
-0
drivers/staging/rtl8188eu/hal/phy.c static bool simularity_compare(struct adapter *adapt, s32 resulta[][8], · line 1041
Quoted 5 lines
drivers/staging/rtl8188eu/hal/phy.c +1
-1@@ -1038,7 +1038,7 @@ static bool simularity_compare(struct adapter *adapt, s32 resulta[][8], bound =4 ;for (i =0 ; i < bound; i++) { -if ((i ==1 ) || (i ==3 ) || (i ==5 ) || (i ==7 )) { +if (i%2 ==1 ) {
I find this harder to read now, sorry, '%' is not used often in C code for a reason :)
thanks,
greg k-h
Quoted 16 lines · Greg KH
Quoted 15 lines · Vatika Harlalka
Variable bound takes maximum value 8 so the if condition for odd i is made more compact.
Signed-off-by Vatika Harlalka <[email protected]>--- drivers/staging/rtl8188eu/hal/phy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/rtl8188eu/hal/phy.c +0
-0@@ -1038,7 +1038,7 @@ static bool simularity_compare(struct adapter *adapt, s32 resulta[][8], bound =4 ;
Quoted 6 lines
drivers/staging/rtl8188eu/hal/phy.c static bool simularity_compare(struct adapter *adapt, s32 resulta[][8], · line 1041
Quoted 3 lines
drivers/staging/rtl8188eu/hal/phy.c +1
-1for (i =0 ; i < bound; i++) { -if ((i ==1 ) || (i ==3 ) || (i ==5 ) || (i ==7 )) { +if (i%2 ==1 ) {I find this harder to read now, sorry, '%' is not used often in C code for a reason :)
In this case, it is probably more common in the kernel to use
if ((i & 1) == 1)
in this case.
Jes