JIRA: https://issues.redhat.com/browse/RHEL-54149
commit 2b959bdde4dde14a789070c04b2b8c029884db85
Author: Colin Ian King <colin.i.king@gmail.com>
Date: Thu, 22 Feb 2024 20:36:17 +0000
Static analysis with clang scan build is warning that uninitialized
data is being passed into various functions. Stop these warnings by
initializing temp_decik to zero.
Cleans up clang scan warnings in lines 106, 125, 146 and 164 such as:
drivers/acpi/thermal_lib.c:106:9: warning: 2nd function call argument
is an uninitialized value [core.CallAndMessage]
Kudos to Dan Carpenter for the deeper analysis of this issue.
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
JIRA: https://issues.redhat.com/browse/RHEL-54149
commit b14b2d56168c1bcf00fccb5a2fe746e64ed970cc
Author: Arnd Bergmann <arnd@arndb.de>
Date: Fri, 24 Nov 2023 19:26:49 +0000
The newly added functions are declared in a header that is not included
before the definition:
drivers/acpi/thermal_lib.c:46:5: error: no previous prototype for 'acpi_active_trip_temp' [-Werror=missing-prototypes]
46 | int acpi_active_trip_temp(struct acpi_device *adev, int id, int *ret_temp)
| ^~~~~~~~~~~~~~~~~~~~~
drivers/acpi/thermal_lib.c:57:5: error: no previous prototype for 'acpi_passive_trip_temp' [-Werror=missing-prototypes]
57 | int acpi_passive_trip_temp(struct acpi_device *adev, int *ret_temp)
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/acpi/thermal_lib.c:63:5: error: no previous prototype for 'acpi_hot_trip_temp' [-Werror=missing-prototypes]
63 | int acpi_hot_trip_temp(struct acpi_device *adev, int *ret_temp)
| ^~~~~~~~~~~~~~~~~~
drivers/acpi/thermal_lib.c:69:5: error: no previous prototype for 'acpi_critical_trip_temp' [-Werror=missing-prototypes]
69 | int acpi_critical_trip_temp(struct acpi_device *adev, int *ret_temp)
| ^~~~~~~~~~~~~~~~~~~~~~~
Fixes: 6908097aa5a7 ("ACPI: thermal_lib: Add functions returning temperature in deci-Kelvin")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
JIRA: https://issues.redhat.com/browse/RHEL-54149
commit 9c8647224e9fabb765019193aa43c054a638f808
Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Date: Tue, 21 Nov 2023 15:04:25 +0000
Modify the ACPI thermal driver to use functions from the ACPI thermal
library to obtain trip point temperature values instead of duplicating
them locally.
Among other things, this requires the functions in question to be
exported to it, because it can be built as a module.
It effectively changes the behavior of the driver to treat temperature
values out of the reasonable range (-55 centigrade to 175 centigrade) as
invalid, but there is no other expected functional impact.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
JIRA: https://issues.redhat.com/browse/RHEL-54149
commit 6908097aa5a7bd0c66c0b7ae9dd994b6ef62be8c
Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Date: Tue, 21 Nov 2023 15:04:24 +0000
Because the ACPI thermal driver generally operates temperature values
in deci-Kelvin, it needs the library functions returning temperature
for various trip point types to use deci-Kelvin too.
To address that, arrange the ACPI thermal library code in three levels
of functions where the high-level ones will return temperature in
milli-Celsius, as needed by the thermal core and the majority of
thermal drivers, the mid-level ones will return temperature in
deci-Kelvin and will be called internally by the corresponding high-
level functions, and all of the mid-level functions will call the same
low-level one, acpi_trip_temp(), to actually evaluate ACPI objects to
retrieve themperature values from the platform firmware.
Going forward, this will allow the ACPI thermal driver to use the
mid-level functions to provide temperature values needed by it, so as
to reduce code duplication related to evaluating trip temperature ACPI
control methods.
No intentional functional impact.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
JIRA: https://issues.redhat.com/browse/RHEL-31848
commit f47507988145185aef5d0e7a0e28dbf6e7776f29
Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Date: Tue Oct 17 22:05:23 2023 +0200
thermal: ACPI: Move the ACPI thermal library to drivers/acpi/
The ACPI thermal library contains functions that can be used to
retrieve trip point temperature values through the platform firmware
for various types of trip points. Each of these functions basically
evaluates a specific ACPI object, checks if the value produced by it
is reasonable and returns it (or THERMAL_TEMP_INVALID if anything
fails).
It made sense to hold it in drivers/thermal/ so long as it was only used
by the code in that directory, but since it is also going to be used by
the ACPI thermal driver located in drivers/acpi/, move it to the latter
in order to keep the code related to evaluating ACPI objects defined in
the specification proper together.
No intentional functional impact.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: David Arcari <darcari@redhat.com>