]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ds2760_battery: Fix integer overflow for time_to_empty_now
authorDaniel Mack <daniel@caiaq.de>
Fri, 24 Jul 2009 13:08:11 +0000 (15:08 +0200)
committerAnton Vorontsov <avorontsov@ru.mvista.com>
Fri, 4 Sep 2009 16:26:40 +0000 (20:26 +0400)
commitb0525b48f06714e8d5cf6a3266261b71de8d6dd4
treefaef8c88f77b5d1738feb8a57ef154832b764883
parent83a8af0d31cfa6c728a68c00f6b1b518e2dcc03d
ds2760_battery: Fix integer overflow for time_to_empty_now

On the device we're currently developing, battery sizes of ~2.8Ah and
current flow of ~600mA are typical.

With that values, the life_sec computation overflows due to the
multiplication by 3600.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Szabolcs Gyurko <szabolcs.gyurko@tlt.hu>
Cc: Matt Reimer <mreimer@vpop.net>
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
drivers/power/ds2760_battery.c