2017-08-18 01:09:12

by Gustavo A. R. Silva

[permalink] [raw]
Subject: [PATCH] rtlwifi: btcoex: 23b 1ant: fix duplicated code for different branches

Refactor code in order to avoid identical code for different branches.

This issue was detected with the help of Coccinelle.

Addresses-Coverity-ID: 1415177
Signed-off-by: Gustavo A. R. Silva <[email protected]>
---
This issue was reported by Coverity and it was tested by compilation only.

.../net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b1ant.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b1ant.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b1ant.c
index 03998d2..c044252 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b1ant.c
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b1ant.c
@@ -600,14 +600,8 @@ static void halbtc8723b1ant_coex_table_with_type(struct btc_coexist *btcoexist,
0xffffff, 0x3);
break;
case 5:
- if ((coex_sta->cck_ever_lock) && (coex_sta->scan_ap_num <= 5))
- halbtc8723b1ant_coex_table(btcoexist, force_exec,
- 0x5a5a5a5a, 0x5aaa5a5a,
- 0xffffff, 0x3);
- else
- halbtc8723b1ant_coex_table(btcoexist, force_exec,
- 0x5a5a5a5a, 0x5aaa5a5a,
- 0xffffff, 0x3);
+ halbtc8723b1ant_coex_table(btcoexist, force_exec, 0x5a5a5a5a,
+ 0x5aaa5a5a, 0xffffff, 0x3);
break;
case 6:
halbtc8723b1ant_coex_table(btcoexist, force_exec, 0x55555555,
--
2.5.0


2017-08-31 04:48:42

by Larry Finger

[permalink] [raw]
Subject: Re: [PATCH] rtlwifi: btcoex: 23b 1ant: fix duplicated code for different branches

On 08/30/2017 08:42 AM, Gustavo A. R. Silva wrote:
> Refactor code in order to avoid identical code for different branches.
>
> This issue was detected with the help of Coccinelle.
>
> Addresses-Coverity-ID: 1226788
> Signed-off-by: Gustavo A. R. Silva <[email protected]>
> ---
> This issue was reported by Coverity and it was tested by compilation only.
> I'm suspicious this may be a copy/paste error. Please, verify.
>
> .../net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b1ant.c | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)

This change is not correct. When bt_link_info->sco_exist is true, the call should be

halbtc8723b1ant_limited_rx(btcoexist,
NORMAL_EXEC, true,
false, 0x5);

NACK

I will push the correct patch.

Larry

2017-08-24 09:52:45

by Kalle Valo

[permalink] [raw]
Subject: Re: rtlwifi: btcoex: 23b 1ant: fix duplicated code for different branches

"Gustavo A. R. Silva" <[email protected]> wrote:

> Refactor code in order to avoid identical code for different branches.
>
> This issue was detected with the help of Coccinelle.
>
> Addresses-Coverity-ID: 1415177
> Signed-off-by: Gustavo A. R. Silva <[email protected]>

Patch applied to wireless-drivers-next.git, thanks.

14cc696c0a4a rtlwifi: btcoex: 23b 1ant: fix duplicated code for different branches

--
https://patchwork.kernel.org/patch/9907397/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

2017-09-07 14:56:57

by Gustavo A. R. Silva

[permalink] [raw]
Subject: Re: [PATCH] rtlwifi: btcoex: 23b 1ant: fix duplicated code for different branches

Hi Larry,

On 08/30/2017 11:48 PM, Larry Finger wrote:
> On 08/30/2017 08:42 AM, Gustavo A. R. Silva wrote:
>> Refactor code in order to avoid identical code for different branches.
>>
>> This issue was detected with the help of Coccinelle.
>>
>> Addresses-Coverity-ID: 1226788
>> Signed-off-by: Gustavo A. R. Silva <[email protected]>
>> ---
>> This issue was reported by Coverity and it was tested by compilation
>> only.
>> I'm suspicious this may be a copy/paste error. Please, verify.
>>
>> .../net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b1ant.c | 10
>> ++--------
>> 1 file changed, 2 insertions(+), 8 deletions(-)
>
> This change is not correct. When bt_link_info->sco_exist is true, the
> call should be
>
> halbtc8723b1ant_limited_rx(btcoexist,
> NORMAL_EXEC, true,
> false, 0x5);
>
> NACK
>
> I will push the correct patch.
>

Great. Good to know.

Thanks
--
Gustavo A. R. Silva