rtlwifi: btcoexist: adjust double test
Subsystems (3)
PATCH 1/1 rtlwifi: btcoexist: adjust double test
Rewrite a duplicated test to test the correct value
The Coccinelle semantic patch that finds this problem is:
// <smpl>
@@
expression E;
@@
(
* E
|| ... || E |
* E
&& ... && E
)
// </smpl>
---
In file drivers/staging/rtl8192ee/btcoexist/halbtcoutsrc.c, there is a similar function that tests for WIRELESS_MODE_G and WIRELESS_MODE_B. I have not tested the code, so you am not sure whether it is the correct solution.
drivers/net/wireless/rtlwifi/btcoexist/halbtcoutsrc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/rtlwifi/btcoexist/halbtcoutsrc.c +1 -1
@@ -101,7 +101,7 @@ static bool halbtc_legacy(struct rtl_priv *adapter)bool is_legacy = false; -if ((mac->mode ==WIRELESS_MODE_B ) || (mac->mode ==WIRELESS_MODE_B )) +if ((mac->mode ==WIRELESS_MODE_B ) || (mac->mode ==WIRELESS_MODE_G )) is_legacy = true;return is_legacy;
Signature · 1 line
1.9.1
Quoted 33 lines · Himangi Saraogi
Rewrite a duplicated test to test the correct value
The Coccinelle semantic patch that finds this problem is:
// <smpl>
@@
expression E;
@@(
* E|| ... || E |* E
&& ... && E
)
// </smpl>Signed-off-by Himangi Saraogi <[email protected]>---
In filedrivers/staging/rtl8192ee/btcoexist/halbtcoutsrc.c, there is a similar function that tests forWIRELESS_MODE_GandWIRELESS_MODE_B. I have not tested the code, so you am not sure whether it is the correct solution.drivers/net/wireless/rtlwifi/btcoexist/halbtcoutsrc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/wireless/rtlwifi/btcoexist/halbtcoutsrc.c +0
-0
drivers/net/wireless/rtlwifi/btcoexist/halbtcoutsrc.c static bool halbtc_legacy(struct rtl_priv *adapter) · line 107
Quoted 8 lines
drivers/net/wireless/rtlwifi/btcoexist/halbtcoutsrc.c +1
-1@@ -101,7 +101,7 @@ static bool halbtc_legacy(struct rtl_priv *adapter)bool is_legacy = false; -if ((mac->mode ==WIRELESS_MODE_B ) || (mac->mode ==WIRELESS_MODE_B )) +if ((mac->mode ==WIRELESS_MODE_B ) || (mac->mode ==WIRELESS_MODE_G )) is_legacy = true;return is_legacy;
The latest version of the vendor driver has this change already applied.
Larry