Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 06895b16 authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Kalle Valo
Browse files

rtlwifi: remove duplicate code



Remove and refactor some code in order to avoid having identical code
for different branches.

Notice that the logic has been there since 2014.

Addresses-Coverity-ID: 1426199 ("Identical code for different branches")
Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent db69f4e0
Loading
Loading
Loading
Loading
+4 −19
Original line number Diff line number Diff line
@@ -2876,25 +2876,10 @@ static void btc8723b2ant_action_hid(struct btc_coexist *btcoexist)
		btc8723b2ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 13);

	/* sw mechanism */
	if (BTC_WIFI_BW_HT40 == wifi_bw) {
		if ((wifi_rssi_state == BTC_RSSI_STATE_HIGH) ||
		    (wifi_rssi_state == BTC_RSSI_STATE_STAY_HIGH)) {
			btc8723b2ant_sw_mechanism(btcoexist, true, true,
						  false, false);
		} else {
			btc8723b2ant_sw_mechanism(btcoexist, true, true,
						  false, false);
		}
	} else {
		if ((wifi_rssi_state == BTC_RSSI_STATE_HIGH) ||
		    (wifi_rssi_state == BTC_RSSI_STATE_STAY_HIGH)) {
			btc8723b2ant_sw_mechanism(btcoexist, false, true,
						  false, false);
		} else {
			btc8723b2ant_sw_mechanism(btcoexist, false, true,
						  false, false);
		}
	}
	if (wifi_bw == BTC_WIFI_BW_HT40)
		btc8723b2ant_sw_mechanism(btcoexist, true, true, false, false);
	else
		btc8723b2ant_sw_mechanism(btcoexist, false, true, false, false);
}

/* A2DP only / PAN(EDR) only/ A2DP+PAN(HS) */