]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
power: supply: use ktime_divns() to avoid 64-bit division
authorMichal Kubecek <mkubecek@suse.cz>
Wed, 15 Oct 2025 07:56:31 +0000 (09:56 +0200)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Mon, 3 Nov 2025 00:01:57 +0000 (01:01 +0100)
commit3fd1695f5da0538ef72e1268baa00528b589347a
tree61671ad17bc7c04c7b195b1e9f62826b3af45db4
parent06b54f2d741b63e215bc941af4dcfafde3b1b327
power: supply: use ktime_divns() to avoid 64-bit division

The build of intel_dc_ti_battery module on i386 (32-bit) fails with

ERROR: modpost: "__udivdi3" [drivers/power/supply/intel_dc_ti_battery.ko]

This is caused by 64-bit division of ktime values by NSEC_PER_USEC. Use
ktime_divns() helper which handles the division correctly on 32-bit
architectures.

Fixes: 8c5795fe5527 ("power: supply: Add new Intel Dollar Cove TI battery driver")
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
Reviewed-by: Hans de Goede <hansg@kernel.org>
Link: https://patch.msgid.link/20251015075957.8F40620057@lion.mk-sys.cz
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/intel_dc_ti_battery.c