staging: rtl8723bs: Merge workaround conditionals into single else-if.
authorQuytelda Kahja <quytelda@tamalin.org>
Sun, 17 Jun 2018 05:30:39 +0000 (22:30 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Jun 2018 13:03:16 +0000 (22:03 +0900)
The if conditionals used to work around wrong TX power limit indices
can be condensed into a single if/else-if statement for more concise
expression.

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 9e6dc238c028abbc5e7cde78b3514964504ba27c..0e49f0973c1218a97230af010c348ee020161a65 100644 (file)
@@ -1728,15 +1728,12 @@ s8 phy_get_tx_pwr_lmt(struct adapter *adapter, u32 reg_pwr_tbl_sel,
        /*  workaround for wrong index combination to obtain tx power limit, */
        /*  OFDM only exists in BW 20M */
        /*  CCK table will only be given in BW 20M */
+       /*  HT on 80M will reference to HT on 40M */
        if (idx_rate_sctn == 0 || idx_rate_sctn == 1)
                idx_bandwidth = 0;
-
-       /*  workaround for wrong index combination to obtain tx power limit, */
-       /*  HT on 80M will reference to HT on 40M */
-       if ((idx_rate_sctn == 2 || idx_rate_sctn == 3) &&
-           band_type == BAND_ON_5G && idx_bandwidth == 2) {
+       else if ((idx_rate_sctn == 2 || idx_rate_sctn == 3) &&
+                (band_type == BAND_ON_5G) && (idx_bandwidth == 2))
                idx_bandwidth = 1;
-       }
 
        if (band_type == BAND_ON_2_4G || band_type == BAND_ON_5G)
                channel = phy_GetChannelIndexOfTxPowerLimit(band_type, channel);