Skip to contentSkip to conversation

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

PATCH NAK Gustavo A. R. Silva 2 participants 5 messages Aug 30, 2017 – Sep 7, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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: 1226788

---
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(-)
drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b1ant.c +2 -8
index c044252..960ce80f 100644
@@ -2260,14 +2260,8 @@ static void halbtc8723b1ant_run_coexist_mechanism(struct btc_coexist *btcoexist)
 
 		if (iot_peer != BTC_IOT_PEER_CISCO &&
 		    iot_peer != BTC_IOT_PEER_BROADCOM) {
-			if (bt_link_info->sco_exist)
-				halbtc8723b1ant_limited_rx(btcoexist,
-							   NORMAL_EXEC, false,
-							   false, 0x5);
-			else
-				halbtc8723b1ant_limited_rx(btcoexist,
-							   NORMAL_EXEC, false,
-							   false, 0x5);
+			halbtc8723b1ant_limited_rx(btcoexist, NORMAL_EXEC,
+						   false, false, 0x5);
 		} else {
 			if (bt_link_info->sco_exist) {
 				halbtc8723b1ant_limited_rx(btcoexist,
Signature · 1 line
2.5.0
#1 lore raw
Quoted 9 lines · Gustavo A. R. Silva

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

This issue was detected with the help of Coccinelle.

Addresses-Coverity-ID: 1226788

---
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.

I have referred this change to the engineers at Realtek. For the moment, please hold this patch.

Thanks for reporting the condition.

Larry

#2 lore raw

Hi Larry,

Quoted 12 lines · Larry Finger
Quoted 10 lines · Gustavo A. R. Silva

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

This issue was detected with the help of Coccinelle.

Addresses-Coverity-ID: 1226788

---
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.

Quoted 5 lines

I have referred this change to the engineers at Realtek. For the moment, please hold this patch.

Thanks for reporting the condition.

Glad to help. :)

Signature · 1 line
Gustavo A. R. Silva
#3 lore raw
In reply to Gustavo A. R. Silva
Quoted 4 lines · Gustavo A. R. Silva

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

This issue was detected with the help of Coccinelle.

Quoted 8 lines

Addresses-Coverity-ID: 1226788

---
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

#4 lore raw

Hi Larry,

Quoted 19 lines · Larry Finger
Quoted 6 lines · Gustavo A. R. Silva

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

This issue was detected with the help of Coccinelle.

Addresses-Coverity-ID: 1226788

Quoted 8 lines

---
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

Quoted 8 lines
                halbtc8723b1ant_limited_rx(btcoexist,
                               NORMAL_EXEC, true,
                               false, 0x5);

NACK

I will push the correct patch.

Great. Good to know.

Thanks

Signature · 1 line
Gustavo A. R. Silva