Re: [PATCH] power: supply: use ktime_divns() to avoid 64-bit division

From: Dhruva Gole

Date: Wed Oct 15 2025 - 07:57:38 EST


On Oct 15, 2025 at 09:56:31 +0200, Michal Kubecek wrote:
> 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@xxxxxxx>
> ---

Good catch!
Reviewed-by: Dhruva Gole <d-gole@xxxxxx>

--
Best regards,
Dhruva Gole
Texas Instruments Incorporated