diff -uNr upower-0.99.5/src/linux/up-device-supply.c upower-0.99.5-patched/src/linux/up-device-supply.c --- upower-0.99.5/src/linux/up-device-supply.c 2017-04-10 13:16:37.000000000 +0200 +++ upower-0.99.5-patched/src/linux/up-device-supply.c 2017-08-18 01:50:57.029084961 +0200 @@ -272,16 +272,14 @@ } while (i != supply->priv->energy_old_first); /* Check that at least 3 points were involved in computation */ - if (sum_x == 0.0f || valid_values < 3) + if (valid_values < 3) return supply->priv->rate_old; /* Compute the discharge per hour, and not per second */ rate /= sum_x / SECONDS_PER_HOUR_F; - /* if the rate is zero, use the old rate. It will usually happens if no - * data is in the buffer yet. If the rate is too high, i.e. more than, - * 100W don't use it. */ - if (rate == 0.0f || rate > 100.0f) + /* If the rate is too high, i.e. more than 100W don't use it. */ + if (rate > 100.0f) return supply->priv->rate_old; return rate;