diff mbox

rtlwifi: rtl8723be: fix duplicated code for different branches

Message ID 20170830170424.GA19424@embeddedgus (mailing list archive)
State Accepted
Commit a9a65a6b2b69e51f453fe26eeba1e45a720bbb05
Delegated to: Kalle Valo
Headers show

Commit Message

Gustavo A. R. Silva Aug. 30, 2017, 5:04 p.m. UTC
Refactor code in order to avoid identical code for different branches.

Addresses-Coverity-ID: 1248728
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
This issue was reported by Coverity and it was tested by compilation only.
Please, verify if this is not a copy/paste error.
Also, notice this code has been there since 2014.

 drivers/net/wireless/realtek/rtlwifi/rtl8723be/dm.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Comments

Larry Finger Aug. 31, 2017, 4:42 a.m. UTC | #1
On 08/30/2017 12:04 PM, Gustavo A. R. Silva wrote:
> Refactor code in order to avoid identical code for different branches.
> 
> Addresses-Coverity-ID: 1248728
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

According to Realtek, this change is OK.

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

Thanks,

Larry

> ---
> This issue was reported by Coverity and it was tested by compilation only.
> Please, verify if this is not a copy/paste error.
> Also, notice this code has been there since 2014.
> 
>   drivers/net/wireless/realtek/rtlwifi/rtl8723be/dm.c | 8 ++------
>   1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/dm.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/dm.c
> index 131c0d1..15c117e 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/dm.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/dm.c
> @@ -883,12 +883,8 @@ static void rtl8723be_dm_txpower_tracking_callback_thermalmeter(
>   	if ((rtldm->power_index_offset[RF90_PATH_A] != 0) &&
>   	    (rtldm->txpower_track_control)) {
>   		rtldm->done_txpower = true;
> -		if (thermalvalue > rtlefuse->eeprom_thermalmeter)
> -			rtl8723be_dm_tx_power_track_set_power(hw, BBSWING, 0,
> -							     index_for_channel);
> -		else
> -			rtl8723be_dm_tx_power_track_set_power(hw, BBSWING, 0,
> -							     index_for_channel);
> +		rtl8723be_dm_tx_power_track_set_power(hw, BBSWING, 0,
> +						      index_for_channel);
>   
>   		rtldm->swing_idx_cck_base = rtldm->swing_idx_cck;
>   		rtldm->swing_idx_ofdm_base[RF90_PATH_A] =
>
Kalle Valo Aug. 31, 2017, 1 p.m. UTC | #2
"Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:

> Refactor code in order to avoid identical code for different branches.
> 
> Addresses-Coverity-ID: 1248728
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

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

a9a65a6b2b69 rtlwifi: rtl8723be: fix duplicated code for different branches
diff mbox

Patch

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/dm.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/dm.c
index 131c0d1..15c117e 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/dm.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/dm.c
@@ -883,12 +883,8 @@  static void rtl8723be_dm_txpower_tracking_callback_thermalmeter(
 	if ((rtldm->power_index_offset[RF90_PATH_A] != 0) &&
 	    (rtldm->txpower_track_control)) {
 		rtldm->done_txpower = true;
-		if (thermalvalue > rtlefuse->eeprom_thermalmeter)
-			rtl8723be_dm_tx_power_track_set_power(hw, BBSWING, 0,
-							     index_for_channel);
-		else
-			rtl8723be_dm_tx_power_track_set_power(hw, BBSWING, 0,
-							     index_for_channel);
+		rtl8723be_dm_tx_power_track_set_power(hw, BBSWING, 0,
+						      index_for_channel);
 
 		rtldm->swing_idx_cck_base = rtldm->swing_idx_cck;
 		rtldm->swing_idx_ofdm_base[RF90_PATH_A] =