Skip to content

fix an overflow error on sc27xx power supply

Chunyan Zhang linux-pm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest2 patches 1 replyIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2math64: New DIV_S64_ROUND_CLOSEST helperinclude/linux/math64.h+19 -00 replies
2/2power: supply: sc27xx: prevent adc * 1000 from overflowdrivers/power/supply/sc27xx_fuel_gauge.c+5 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] fix an overflow error on sc27xx power supply

From: Chunyan Zhang <[email protected]>

The patch 2/2 fixes an overflow error by changing to 64-bit divide operations. In order to avoid compile error on 32-bit architectures, this patchset also introduced a new 64-bit helper in patch 1/2.

Changes since v1: (https://lkml.org/lkml/2020/7/17/63)
- Added new help macro DIV_S64_ROUND_CLOSEST;
- Fixed an error reported by kernel test robot <[email protected]>.

Chunyan Zhang (2):
math64: New DIV_S64_ROUND_CLOSEST helper
power: supply: sc27xx: prevent adc * 1000 from overflow

 drivers/power/supply/sc27xx_fuel_gauge.c |  9 +++++----
 include/linux/math64.h                   | 19 +++++++++++++++++++
 2 files changed, 24 insertions(+), 4 deletions(-)
Signature · 1 line
2.20.1