Re: [PATCH v2 2/3] hwmon: (isl28022) Fix integer overflow in power calculation on 32-bit
From: Pradhan, Sanman
Date: Tue Apr 07 2026 - 17:26:24 EST
From: Sanman Pradhan <psanman@xxxxxxxxxxx>
Thanks for the review.
Yes, I checked this.
In this driver, gain is limited to {1, 2, 4, 8} by
isl28022_read_properties(), and regval is a 16-bit register value
(max 65535). The worst-case numerator is:
51200000 * 8 * 65535 = 26843136000000
which is well below U64_MAX, so the multiply cannot overflow.
I'll switch to min_t(u64, ...) here to make the type handling explicit
for the u64 result of div_u64(), if that's ok, and send a v3.
Thank you.
Regards,
Sanman Pradhan