[PATCH] fix compute remaining percentage and time on broken ACPI implementations

David Zeuthen david at fubar.dk
Wed Aug 10 16:38:06 PDT 2005


On Wed, 2005-08-10 at 21:42 +0200, Danny Kukawka wrote:
> Hi,
> 
> this is a patch to fix compute remaining percentage and remaining time on 
> broken ACPI implementations (e.g. with unknown present rate). This patch 
> prevents negative normalised values. The fix base on my other ACPI patches.
> 
> - Changes in util_compute_percentage_charge()/util_compute_time_remaining(): 
>   * return -1 instead of 0 if an error occurs to differentiate between an 
> 	 error and an empty battery.
>   * removed unneeded warning message if calculated "percentage < 0"
>   * return -1 if parameter chargeRate, chargeLevel or chargeLastFull are	
>     negative
> 
> - Changes in battery_refresh_poll():
>   * check now if computed remaining percentage and remaining time values are 
>     valid. Now we only add positive values.

Looks good. Please commit.

Cheers,
David


_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list