OSDN Git Service

rtlwifi: btcoexist: 23b 1ant: fix duplicated code for different branches
authorLarry Finger <Larry.Finger@lwfinger.net>
Thu, 31 Aug 2017 14:48:59 +0000 (09:48 -0500)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 20 Sep 2017 12:41:47 +0000 (15:41 +0300)
A typo led to this issue, which was detected with the help of Coccinelle.

In addition to fixing the error, the code is refactored to eliminate an
if statement.

Addresses-Coverity-ID: 1226788

Reported-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b1ant.c

index c044252..5f726f6 100644 (file)
@@ -2260,14 +2260,11 @@ 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);
+                       bool sco_exist = bt_link_info->sco_exist;
+
+                       halbtc8723b1ant_limited_rx(btcoexist,
+                                                  NORMAL_EXEC, sco_exist,
+                                                  false, 0x5);
                } else {
                        if (bt_link_info->sco_exist) {
                                halbtc8723b1ant_limited_rx(btcoexist,