Staging: rtl8188eu: Replace ternary operator with existing macro
authorVatika Harlalka <vatikaharlalka@gmail.com>
Mon, 23 Feb 2015 18:36:14 +0000 (00:06 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Feb 2015 20:53:48 +0000 (12:53 -0800)
Replace ternary operator with existing abs() macro to increase
code readability.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/hal/phy.c

index e1d192f..175b87e 100644 (file)
@@ -577,9 +577,8 @@ void rtl88eu_dm_txpower_tracking_callback_thermalmeter(struct adapter *adapt)
                }
 
                if (delta > 0 && dm_odm->RFCalibrateInfo.TxPowerTrackControl) {
-                       delta = thermal_val > hal_data->EEPROMThermalMeter ?
-                               (thermal_val - hal_data->EEPROMThermalMeter) :
-                               (hal_data->EEPROMThermalMeter - thermal_val);
+                       delta = abs(hal_data->EEPROMThermalMeter - thermal_val);
+
                        /* calculate new OFDM / CCK offset */
                        if (thermal_val > hal_data->EEPROMThermalMeter)
                                j = 1;