Re: [PATCH v2] hwmon: (pt5161l) Fix invalid temperature reading

From: Guenter Roeck
Date: Mon Aug 26 2024 - 23:58:39 EST


On Mon, Aug 19, 2024 at 06:46:30PM +0800, Cosmo Chou wrote:
> The temperature reading function was using a signed long for the ADC
> code, which could lead to mishandling of invalid codes on 32-bit
> platforms. This allowed out-of-range ADC codes to be incorrectly
> interpreted as valid values and used in temperature calculations.
>
> Change adc_code to u32 to ensure that invalid ADC codes are correctly
> identified on all platforms.
>
> Fixes: 1b2ca93cd059 ("hwmon: Add driver for Astera Labs PT5161L retimer")
> Signed-off-by: Cosmo Chou <chou.cosmo@xxxxxxxxx>

Applied.

Thanks,
Guenter