staging: rtl8188eu: fix HighestRate check in odm_ARFBRefresh_8188E()
Subsystems (2)
PATCH 1/1 staging: rtl8188eu: fix HighestRate check in odm_ARFBRefresh_8188E()
It's incorrect to compare HighestRate with 0x0b twice in the following manner "if (HighestRate > 0x0b) ... else if (HighestRate > 0x0b) ...". The "else if" branch is constantly false. The second comparision should be with 0x03 according to the max_rate_idx in ODM_RAInfo_Init().
--- drivers/staging/rtl8188eu/hal/hal8188e_rate_adaptive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8188eu/hal/hal8188e_rate_adaptive.c +1 -1
@@ -409,7 +409,7 @@ static int odm_ARFBRefresh_8188E(struct odm_dm_struct *dm_odm, struct odm_ra_inf pRaInfo->PTModeSS =3 ; else if (pRaInfo->HighestRate > 0x0b) pRaInfo->PTModeSS = 2; - else if (pRaInfo->HighestRate > 0x0b) + else if (pRaInfo->HighestRate > 0x03) pRaInfo->PTModeSS = 1; else pRaInfo->PTModeSS = 0;
Signature · 1 line
2.21.0
Quoted 20 lines · Denis Efremov
It's incorrect to compare HighestRate with
0x0btwice in the following manner "if (HighestRate >0x0b) ... else if (HighestRate >0x0b) ...". The "else if" branch is constantly false. The second comparision should be with0x03according to themax_rate_idxinODM_RAInfo_Init().Cc Larry Finger <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Cc Michael Straube <[email protected]>Signed-off-by Denis Efremov <[email protected]>--- drivers/staging/rtl8188eu/hal/hal8188e_rate_adaptive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/rtl8188eu/hal/hal8188e_rate_adaptive.c +0
-0
drivers/staging/rtl8188eu/hal/hal8188e_rate_adaptive.c static int odm_ARFBRefresh_8188E(struct odm_dm_struct *dm_odm, struct odm_ra_inf · line 415
Quoted 8 lines
drivers/staging/rtl8188eu/hal/hal8188e_rate_adaptive.c +1
-1@@ -409,7 +409,7 @@ static int odm_ARFBRefresh_8188E(struct odm_dm_struct *dm_odm, struct odm_ra_inf pRaInfo->PTModeSS =3 ; else if (pRaInfo->HighestRate > 0x0b) pRaInfo->PTModeSS = 2; - else if (pRaInfo->HighestRate > 0x0b) + else if (pRaInfo->HighestRate > 0x03) pRaInfo->PTModeSS = 1; else pRaInfo->PTModeSS = 0;
I agree that the original code is wrong; however, I prefer that changes that alter the execution should be tested. I see no evidence that such testing has been done. It probably does not matter because a highest rate between 3 and 0xb means 802.11g is in use, and that may no longer be a real-world situation.
With any future patches, you need to indicate if testing has been done.
Larry