* [PATCH] rtlwifi: btcoexist: adjust double test
@ 2014-08-12 19:39 Himangi Saraogi
2014-08-12 22:14 ` Larry Finger
0 siblings, 1 reply; 2+ messages in thread
From: Himangi Saraogi @ 2014-08-12 19:39 UTC (permalink / raw)
To: Larry Finger, Chaoming Li, John W. Linville, linux-wireless,
netdev, linux-kernel
Cc: julia.lawall
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 <himangi774@gmail.com>
---
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(-)
diff --git a/drivers/net/wireless/rtlwifi/btcoexist/halbtcoutsrc.c b/drivers/net/wireless/rtlwifi/btcoexist/halbtcoutsrc.c
index 33da3df..d4bd550 100644
--- a/drivers/net/wireless/rtlwifi/btcoexist/halbtcoutsrc.c
+++ b/drivers/net/wireless/rtlwifi/btcoexist/halbtcoutsrc.c
@@ -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;
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] rtlwifi: btcoexist: adjust double test
2014-08-12 19:39 [PATCH] rtlwifi: btcoexist: adjust double test Himangi Saraogi
@ 2014-08-12 22:14 ` Larry Finger
0 siblings, 0 replies; 2+ messages in thread
From: Larry Finger @ 2014-08-12 22:14 UTC (permalink / raw)
To: Himangi Saraogi, Chaoming Li, John W. Linville, linux-wireless,
netdev, linux-kernel
Cc: julia.lawall
On 08/12/2014 02:39 PM, Himangi Saraogi wrote:
> 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 <himangi774@gmail.com>
> ---
> 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(-)
>
> diff --git a/drivers/net/wireless/rtlwifi/btcoexist/halbtcoutsrc.c b/drivers/net/wireless/rtlwifi/btcoexist/halbtcoutsrc.c
> index 33da3df..d4bd550 100644
> --- a/drivers/net/wireless/rtlwifi/btcoexist/halbtcoutsrc.c
> +++ b/drivers/net/wireless/rtlwifi/btcoexist/halbtcoutsrc.c
> @@ -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.
Acked-by: Larry.Finger <Larry.Finger@lwfinger.net>
Larry
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-08-12 22:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-12 19:39 [PATCH] rtlwifi: btcoexist: adjust double test Himangi Saraogi
2014-08-12 22:14 ` Larry Finger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).