diff options
author | Zhang Rui <rui.zhang@intel.com> | 2022-11-08 15:50:49 +0800 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2022-12-04 16:45:02 -0800 |
commit | 5c0e64dde80ffe78d930db4e38e6218598aecd85 (patch) | |
tree | d48e854bea888e15c06396123988740c2522632b /drivers/hwmon/coretemp.c | |
parent | ed264e8a7d18c5fec2587ed750c87b75d5348210 (diff) | |
download | linux-5c0e64dde80ffe78d930db4e38e6218598aecd85.tar.gz linux-5c0e64dde80ffe78d930db4e38e6218598aecd85.tar.bz2 linux-5c0e64dde80ffe78d930db4e38e6218598aecd85.zip |
hwmon: (coretemp) Remove obsolete temp_data->valid
Checking for the valid bit of IA32_THERM_STATUS is removed in commit
bf6ea084ebb5 ("hwmon: (coretemp) Do not return -EAGAIN for low
temperatures"), and temp_data->valid is set and never cleared when the
temperature has been read once.
Remove the obsolete temp_data->valid field.
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Link: https://lore.kernel.org/r/20221108075051.5139-2-rui.zhang@intel.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/coretemp.c')
-rw-r--r-- | drivers/hwmon/coretemp.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c index 9bee4d33fbdf..27d88c3a3487 100644 --- a/drivers/hwmon/coretemp.c +++ b/drivers/hwmon/coretemp.c @@ -64,7 +64,6 @@ MODULE_PARM_DESC(tjmax, "TjMax value in degrees Celsius"); * @attr_size: Total number of pre-core attrs displayed in the sysfs. * @is_pkg_data: If this is 1, the temp_data holds pkgtemp data. * Otherwise, temp_data holds coretemp data. - * @valid: If this is 1, the current temperature is valid. */ struct temp_data { int temp; @@ -76,7 +75,6 @@ struct temp_data { u32 status_reg; int attr_size; bool is_pkg_data; - bool valid; struct sensor_device_attribute sd_attrs[TOTAL_ATTRS]; char attr_name[TOTAL_ATTRS][CORETEMP_NAME_LENGTH]; struct attribute *attrs[TOTAL_ATTRS + 1]; @@ -157,7 +155,7 @@ static ssize_t show_temp(struct device *dev, mutex_lock(&tdata->update_lock); /* Check whether the time interval has elapsed */ - if (!tdata->valid || time_after(jiffies, tdata->last_updated + HZ)) { + if (time_after(jiffies, tdata->last_updated + HZ)) { rdmsr_on_cpu(tdata->cpu, tdata->status_reg, &eax, &edx); /* * Ignore the valid bit. In all observed cases the register @@ -166,7 +164,6 @@ static ssize_t show_temp(struct device *dev, * really help at all. */ tdata->temp = tdata->tjmax - ((eax >> 16) & 0x7f) * 1000; - tdata->valid = true; tdata->last_updated = jiffies; } |