On Sat, Jul 27, 2024 at 07:38:15AM -0700, Guenter Roeck wrote: > Module test code reports underflows when writing sensor limits. > > temp2_min: Suspected underflow: [min=-77000, read 101000, written -2147483648] > temp2_max: Suspected underflow: [min=-77000, read 101000, written -2147483648] > temp2_crit: Suspected underflow: [min=-77000, read 101000, written -2147483648] > > Clamp temperature ranges when writing limits to fix the problem. > While at it, use sign_extend32() when reading temperatures to make > the code easier to understand. > > Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx> Reviewed-by: Tzung-Bi Shih <tzungbi@xxxxxxxxxx>