mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] fix an overflow error on sc27xx power supply
@ 2020-07-24 12:21 Chunyan Zhang
  2020-07-24 12:21 ` [PATCH v2 1/2] math64: New DIV_S64_ROUND_CLOSEST helper Chunyan Zhang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Chunyan Zhang @ 2020-07-24 12:21 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: linux-pm, linux-kernel, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Chunyan Zhang, Chen Yongzhi

From: Chunyan Zhang <chunyan.zhang@unisoc.com>

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 <lkp@intel.com>.

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(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-07-27 23:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-24 12:21 [PATCH v2 0/2] fix an overflow error on sc27xx power supply Chunyan Zhang
2020-07-24 12:21 ` [PATCH v2 1/2] math64: New DIV_S64_ROUND_CLOSEST helper Chunyan Zhang
2020-07-24 12:21 ` [PATCH v2 2/2] power: supply: sc27xx: prevent adc * 1000 from overflow Chunyan Zhang
2020-07-27 23:14 ` [PATCH v2 0/2] fix an overflow error on sc27xx power supply Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome