linux/drivers/hwmon
Cosmo Chou 7bbc079531 hwmon: (pt5161l) Fix invalid temperature reading
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: 1b2ca93cd0 ("hwmon: Add driver for Astera Labs PT5161L retimer")
Signed-off-by: Cosmo Chou <chou.cosmo@gmail.com>
Message-ID: <20240819104630.2375441-1-chou.cosmo@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-08-26 20:58:05 -07:00
..
occ
peci peci, hwmon: Switch to new Intel CPU model defines 2024-06-17 15:15:46 +02:00
pmbus hwmon: (pmbus/ltc4286) Drop unused i2c device ids 2024-07-10 07:11:34 -07:00
abituguru3.c
abituguru.c
acpi_power_meter.c hwmon: (acpi_power_meter) Ensure IPMI space handler is ready on Dell systems 2024-04-28 10:07:34 -07:00
ad7314.c
ad7414.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
ad7418.c hwmon: (ad7418) Remove use of i2c_match_id() 2024-06-08 16:07:32 -07:00
adc128d818.c hwmon: (adc128d818) Fix underflows seen when writing limit attributes 2024-07-07 07:48:25 -07:00
adcxx.c
adm1025.c
adm1026.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
adm1029.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
adm1031.c hwmon: (adm1031) Remove use of i2c_match_id() 2024-06-08 16:07:32 -07:00
adm1177.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
adm9240.c
ads7828.c hwmon: (ads7828) Remove use of i2c_match_id() 2024-06-08 16:07:32 -07:00
ads7871.c
adt7x10.c
adt7x10.h
adt7310.c
adt7410.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
adt7411.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
adt7462.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
adt7470.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
adt7475.c minmax: make generic MIN() and MAX() macros available everywhere 2024-07-28 15:49:18 -07:00
aht10.c hwmon: (aht10) Remove use of i2c_match_id() 2024-06-08 16:07:32 -07:00
amc6821.c hwmon: (amc6821) Add support for pwm1_mode attribute 2024-07-08 07:52:36 -07:00
applesmc.c
aquacomputer_d5next.c hwmon: (aquacomputer_d5next) Add support for Octo flow sensor pulses 2024-04-30 10:32:14 -07:00
as370-hwmon.c
asb100.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
asc7621.c
aspeed-g6-pwm-tach.c pwm: Changes for v6.10-rc1 2024-05-14 15:03:19 -07:00
aspeed-pwm-tacho.c
asus_atk0110.c hwmon: add missing MODULE_DESCRIPTION() macros 2024-06-08 16:07:33 -07:00
asus_rog_ryujin.c
asus_wmi_sensors.c
asus-ec-sensors.c hwmon: (asus-ec-sensors) remove VRM temp X570-E GAMING 2024-08-25 15:26:25 -07:00
atxp1.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
axi-fan-control.c
bt1-pvt.c
bt1-pvt.h
chipcap2.c
coretemp.c hwmon: (coretemp) Extend the bitmask to read temperature to 0xff 2024-04-28 10:08:43 -07:00
corsair-cpro.c hwmon: add missing MODULE_DESCRIPTION() macros 2024-06-08 16:07:33 -07:00
corsair-psu.c hwmon: corsair-psu: add USB id of HX1200i Series 2023 psu 2024-05-29 15:33:18 -07:00
cros_ec_hwmon.c hwmon: (cros_ec) Fix access to restricted __le16 2024-06-07 09:59:58 +00:00
da9052-hwmon.c hwmon: (da9052) Use devm_regulator_get_enable_read_voltage() 2024-05-03 11:08:14 +09:00
da9055-hwmon.c
dell-smm-hwmon.c hwmon updates for v6.11-rc1 2024-07-15 17:39:13 -07:00
dme1737.c hwmon: (dme1737) Remove use of i2c_match_id() 2024-06-08 16:07:32 -07:00
drivetemp.c
ds620.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
ds1621.c hwmon: (ds1621) Remove use of i2c_match_id() 2024-06-08 16:07:32 -07:00
emc6w201.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
emc1403.c hwmon: (emc1403) Add support for EMC1428 and EMC1438. 2024-05-12 09:02:00 -07:00
emc2103.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
emc2305.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
f71805f.c
f71882fg.c
f75375s.c hwmon: (f75375s) Remove use of i2c_match_id() 2024-06-08 16:07:32 -07:00
fam15h_power.c
fschmd.c hwmon: (fschmd) Remove use of i2c_match_id() 2024-06-08 16:07:32 -07:00
ftsteutates.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
g760a.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
g762.c hwmon: (g762) Initialize fans after configuring clock 2024-07-09 15:45:48 -07:00
gigabyte_waterforce.c
gl518sm.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
gl520sm.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
gpio-fan.c
gsc-hwmon.c hwmon: (gsc-hwmon) constify read-only struct regmap_bus 2024-07-05 14:37:01 -07:00
gxp-fan-ctrl.c
hih6130.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
hp-wmi-sensors.c
hs3001.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
hwmon-vid.c
hwmon.c hwmon: (core) Make hwmon_class const 2024-06-13 16:44:34 -07:00
i5k_amb.c hwmon: Use device_show_string() helper for sysfs attributes 2024-05-04 17:37:03 +02:00
i5500_temp.c
ibmaem.c
ibmpex.c hwmon: Use device_show_string() helper for sysfs attributes 2024-05-04 17:37:03 +02:00
ibmpowernv.c
iio_hwmon.c Char/Misc and other driver changes for 6.11-rc1 2024-07-19 15:55:08 -07:00
ina2xx.c hwmon: (ina2xx) Add device tree support to pass alert polarity 2024-06-12 07:15:09 -07:00
ina209.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
ina238.c hwmon: (ina238) Constify struct regmap_config 2024-07-02 11:30:10 -07:00
ina3221.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
intel-m10-bmc-hwmon.c hwmon: (intel-m10-bmc-hwmon) Fix multiplier for N6000 board power sensor 2024-05-30 09:05:06 -07:00
it87.c hwmon: (it87) Remove tests nolonger required 2024-04-30 10:32:14 -07:00
jc42.c hwmon: (jc42) Strengthen detect function 2024-06-30 13:15:26 -07:00
k8temp.c
k10temp.c hwmon: (k10temp) Rename _data variable 2024-06-12 11:40:31 +02:00
Kconfig hwmon updates for v6.11-rc1 2024-07-15 17:39:13 -07:00
lan966x-hwmon.c
lenovo-ec-sensors.c hwmon: Add EC Chip driver for Lenovo ThinkStation motherboards 2024-04-30 10:31:26 -07:00
lineage-pem.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
lm63.c hwmon: (lm63) Remove use of i2c_match_id() 2024-06-08 16:07:32 -07:00
lm70.c hwmon: lm70: simplify with spi_get_device_match_data() 2024-06-08 16:07:32 -07:00
lm73.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
lm75.c hwmon: (lm75) Remove use of i2c_match_id() 2024-06-08 16:07:32 -07:00
lm75.h
lm77.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
lm78.c hwmon: (lm78) Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
lm80.c
lm83.c hwmon: (lm83) Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
lm85.c hwmon: (lm85) Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
lm87.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 (part 2) 2024-05-09 12:56:06 -07:00
lm90.c hwmon: (lm90) Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
lm92.c
lm93.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
lm95234.c hwmon: (lm95234) Fix underflows seen when writing limit attributes 2024-07-07 07:48:25 -07:00
lm95241.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 (part 2) 2024-05-09 12:56:06 -07:00
lm95245.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
lochnagar-hwmon.c
ltc2945.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
ltc2947-core.c
ltc2947-i2c.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
ltc2947-spi.c
ltc2947.h
ltc2990.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
ltc2991.c hwmon: (ltc2991) re-order conditions to fix off by one bug 2024-07-04 18:14:50 -07:00
ltc2992.c hwmon: (ltc2992) Fix memory leak in ltc2992_parse_dt() 2024-05-29 15:34:46 -07:00
ltc4151.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
ltc4215.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
ltc4222.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
ltc4245.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
ltc4260.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
ltc4261.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
ltc4282.c
ltq-cputemp.c
Makefile hwmon updates for v6.11-rc1 2024-07-15 17:39:13 -07:00
max127.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
max197.c
max1111.c
max1619.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
max1668.c hwmon: (max1668) Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
max6620.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
max6621.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 (part 2) 2024-05-09 12:56:06 -07:00
max6639.c hwmon: (max6639) : Add additional hwmon attributes for fan and pwm 2024-06-14 06:37:06 -07:00
max6650.c
max6697.c hwmon: (max6697) Fix swapped temp{1,8} critical alarms 2024-07-14 11:49:01 -07:00
max16065.c hwmon: (max16065) Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
max31722.c
max31730.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
max31760.c
max31790.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
max31827.c hwmon: (pmbus/max31827) Explain why enum chips must not start with 0 2024-06-11 07:25:03 -07:00
mc34vr500.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
mc13783-adc.c
mcp3021.c hwmon: (mcp3021) Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
menf21bmc_hwmon.c
mlxreg-fan.c
mr75203.c hwmon: add missing MODULE_DESCRIPTION() macros 2024-06-08 16:07:33 -07:00
nct6683.c hwmon: (nct6683) Display warning when enabling driver for unknown customer 2024-05-29 15:23:54 -07:00
nct6775-core.c hwmon: (nct6775-core) Fix underflows seen when writing limit attributes 2024-07-07 07:48:25 -07:00
nct6775-i2c.c
nct6775-platform.c
nct6775.h hwmon: (nct6775) Let enum kinds start with index 0 2024-06-11 07:25:13 -07:00
nct7802.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
nct7904.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
npcm750-pwm-fan.c hwmon: (npcm750-pwm-fan) Remove another unused field in struct npcm7xx_cooling_device 2024-05-01 07:47:49 -07:00
nsa320-hwmon.c
ntc_thermistor.c
nzxt-kraken2.c
nzxt-kraken3.c hwmon: (nzxt-kraken3) Bail out for unsupported device variants 2024-05-12 16:50:11 -07:00
nzxt-smart2.c hwmon: (nzxt-smart2) Add support for another version of NZXT RGB & Fan Controller 2024-05-29 15:55:35 -07:00
oxp-sensors.c
pc87360.c
pc87427.c
pcf8591.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
powerz.c
powr1220.c hwmon: (powr1220) Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
pt5161l.c hwmon: (pt5161l) Fix invalid temperature reading 2024-08-26 20:58:05 -07:00
pwm-fan.c hwmon: (pwm-fan) Make use of device properties 2024-04-28 10:08:33 -07:00
raspberrypi-hwmon.c
sbrmi.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
sbtsi_temp.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
sch56xx-common.c
sch56xx-common.h
sch5627.c
sch5636.c
scmi-hwmon.c
scpi-hwmon.c
sfctemp.c
sht3x.c hwmon: (sht3x) Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
sht4x.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
sht15.c
sht21.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
shtc1.c hwmon updates for v6.11-rc1 2024-07-15 17:39:13 -07:00
sis5595.c
sl28cpld-hwmon.c
smpro-hwmon.c
smsc47b397.c
smsc47m1.c
smsc47m192.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
sparx5-temp.c
spd5118.c hwmon: (spd5118) Add support for Renesas/ITD SPD5118 hub controllers 2024-06-18 20:07:42 -07:00
stts751.c hwmon: (stts751) Remove an unused field in struct stts751_priv 2024-05-01 07:47:49 -07:00
surface_fan.c
sy7636a-hwmon.c
tc74.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
tc654.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
thmc50.c hwmon: (thmc50) Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
tmp102.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
tmp103.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
tmp108.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
tmp401.c hwmon: (tmp401) Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
tmp421.c hwmon: (tmp421) Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
tmp464.c hwmon: (tmp464) Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
tmp513.c hwmon: (tmp513) Constify struct regmap_config 2024-07-02 11:31:02 -07:00
tps23861.c hwmon: (tps23861) Constify struct regmap_config 2024-07-02 11:31:30 -07:00
ultra45_env.c Normalise "name (ad@dr)" MODULE_AUTHORs to "name <ad@dr>" 2024-03-06 13:07:39 -08:00
vexpress-hwmon.c
via686a.c
via-cputemp.c
vt1211.c
vt8231.c
w83l785ts.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
w83l786ng.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
w83627ehf.c hwmon: (w83627ehf) Fix underflows seen when writing limit attributes 2024-07-07 07:48:25 -07:00
w83627hf.c
w83773g.c
w83781d.c hwmon: (w83781d) Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
w83791d.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
w83792d.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
w83793.c hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-01 07:47:49 -07:00
w83795.c hwmon: (w83795): Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
wm831x-hwmon.c
wm8350-hwmon.c
xgene-hwmon.c