Re: [PATCH v2 1/2] hwmon: (max6621) fix temperature clamp range
Guenter Roeck <[email protected]>
| Newsgroups | org.kernel.vger.linux-hwmon,org.kernel.vger.linux-kernel,org.kernel.vger.stable |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Aug 10, 2026 at 11:27:54AM +0700, Cong Nguyen wrote:
> MAX6621_TEMP_INPUT_MIN and MAX6621_TEMP_INPUT_MAX are used to clamp the
> writable offset and critical thresholds. They are defined as -127000 and
> 128000.
>
> The driver decodes the temperature through an s8 and its own comment in
> max6621_read() documents an 8-bit two's complement value, whose range is
> -128 to +127 degrees C. The current limits therefore reject the valid
> -128 degrees C and accept +128 degrees C, which does not fit the 8-bit
> range.
>
> Correct the limits to -128000 and 127000.
>
> Fixes: 92b64580f14b ("hwmon: (max6621) Add support for Maxim MAX6621 temperature sensor")
> Cc: [email protected]
> Assisted-by: Claude:claude-opus-4
> Signed-off-by: Cong Nguyen <[email protected]>
Applied.
Thanks,
Guenter