On Sat, Jul 13, 2024 at 02:34:02PM -0700, Guenter Roeck wrote: > Using DIV_ROUND_CLOSEST() on an unbound value can result in underflows. > Indeed, module test scripts report: > > temp1_max: Suspected underflow: [min=0, read 255000, written -9223372036854775808] > temp1_crit: Suspected underflow: [min=0, read 255000, written -9223372036854775808] > > Fix by introducing an extra set of clamping. > > Fixes: 5372d2d71c46 ("hwmon: Driver for Maxim MAX6697 and compatibles") > Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx> Reviewed-by: Tzung-Bi Shih <tzungbi@xxxxxxxxxx>