staging: rtl8723bs: Merge conditionals with similar bodies.
authorQuytelda Kahja <quytelda@tamalin.org>
Sun, 17 Jun 2018 05:30:38 +0000 (22:30 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Jun 2018 13:03:16 +0000 (22:03 +0900)
Two conditionals that set 'channel' based on 'band_type' in
'phy_get_tx_pwr_lmt()' can be simplified into one single-line conditional.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/hal/hal_com_phycfg.c

index dd097df86fa3594f2c0f33babeb896e0cd4955e2..9e6dc238c028abbc5e7cde78b3514964504ba27c 100644 (file)
@@ -1738,12 +1738,8 @@ s8 phy_get_tx_pwr_lmt(struct adapter *adapter, u32 reg_pwr_tbl_sel,
                idx_bandwidth = 1;
        }
 
-       if (band_type == BAND_ON_2_4G)
-               channel = phy_GetChannelIndexOfTxPowerLimit(BAND_ON_2_4G,
-                                                           channel);
-       else if (band_type == BAND_ON_5G)
-               channel = phy_GetChannelIndexOfTxPowerLimit(BAND_ON_5G,
-                                                           channel);
+       if (band_type == BAND_ON_2_4G || band_type == BAND_ON_5G)
+               channel = phy_GetChannelIndexOfTxPowerLimit(band_type, channel);
 
        if (idx_band == -1 || idx_regulation == -1 || idx_bandwidth == -1 ||
            idx_rate_sctn == -1 || idx_channel == -1) {