power: pm8921-bms: Fix coulomb counter overflow
The coulomb counter in hardware is 32bits and is signed. The software
also adds a 32bit value (the cc reading when end of charge happened).
This addition might cause the value of the coulomb counter to overflow.
Fix it by switching to 64bit values before adding to it.
CRs-Fixed: 328352
Change-Id: Ic8268014fccca00acd03b0693896ab494fe94d87
Signed-off-by:
Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Loading
Please sign in to comment