]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ath9k: Remove unnecessary ?: operator
authorIvan Safonov <insafonov@gmail.com>
Fri, 18 Mar 2016 02:16:26 +0000 (13:16 +1100)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 7 Apr 2016 16:37:32 +0000 (19:37 +0300)
"(thermometer < 0) ? 0 : (thermometer == X)" is equivalent to
"thermometer == X" for X >= 0.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
[Updated commit message]
Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c

index 54ed2f72d35eb27c4a8998a83463afcaae0c8cc1..a049f8d34f9964039e62392420ff35d00c312654 100644 (file)
@@ -4097,16 +4097,16 @@ static void ar9003_hw_thermometer_apply(struct ath_hw *ah)
                REG_RMW_FIELD(ah, AR_PHY_65NM_CH2_RXTX4,
                              AR_PHY_65NM_CH0_RXTX4_THERM_ON_OVR, therm_on);
 
-       therm_on = (thermometer < 0) ? 0 : (thermometer == 0);
+       therm_on = thermometer == 0;
        REG_RMW_FIELD(ah, AR_PHY_65NM_CH0_RXTX4,
                      AR_PHY_65NM_CH0_RXTX4_THERM_ON, therm_on);
        if (pCap->chip_chainmask & BIT(1)) {
-               therm_on = (thermometer < 0) ? 0 : (thermometer == 1);
+               therm_on = thermometer == 1;
                REG_RMW_FIELD(ah, AR_PHY_65NM_CH1_RXTX4,
                              AR_PHY_65NM_CH0_RXTX4_THERM_ON, therm_on);
        }
        if (pCap->chip_chainmask & BIT(2)) {
-               therm_on = (thermometer < 0) ? 0 : (thermometer == 2);
+               therm_on = thermometer == 2;
                REG_RMW_FIELD(ah, AR_PHY_65NM_CH2_RXTX4,
                              AR_PHY_65NM_CH0_RXTX4_THERM_ON, therm_on);
        }