Skip to content

Commit 2b959bd

Browse files
ColinIanKingrafaeljw
authored andcommitted
ACPI: thermal_lib: Initialize temp_decik to zero
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>
1 parent b401b62 commit 2b959bd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/acpi/thermal_lib.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static int thermal_temp(int error, int temp_decik, int *ret_temp)
100100
*/
101101
int thermal_acpi_active_trip_temp(struct acpi_device *adev, int id, int *ret_temp)
102102
{
103-
int temp_decik;
103+
int temp_decik = 0;
104104
int ret = acpi_active_trip_temp(adev, id, &temp_decik);
105105

106106
return thermal_temp(ret, temp_decik, ret_temp);
@@ -119,7 +119,7 @@ EXPORT_SYMBOL_GPL(thermal_acpi_active_trip_temp);
119119
*/
120120
int thermal_acpi_passive_trip_temp(struct acpi_device *adev, int *ret_temp)
121121
{
122-
int temp_decik;
122+
int temp_decik = 0;
123123
int ret = acpi_passive_trip_temp(adev, &temp_decik);
124124

125125
return thermal_temp(ret, temp_decik, ret_temp);
@@ -139,7 +139,7 @@ EXPORT_SYMBOL_GPL(thermal_acpi_passive_trip_temp);
139139
*/
140140
int thermal_acpi_hot_trip_temp(struct acpi_device *adev, int *ret_temp)
141141
{
142-
int temp_decik;
142+
int temp_decik = 0;
143143
int ret = acpi_hot_trip_temp(adev, &temp_decik);
144144

145145
return thermal_temp(ret, temp_decik, ret_temp);
@@ -158,7 +158,7 @@ EXPORT_SYMBOL_GPL(thermal_acpi_hot_trip_temp);
158158
*/
159159
int thermal_acpi_critical_trip_temp(struct acpi_device *adev, int *ret_temp)
160160
{
161-
int temp_decik;
161+
int temp_decik = 0;
162162
int ret = acpi_critical_trip_temp(adev, &temp_decik);
163163

164164
return thermal_temp(ret, temp_decik, ret_temp);

0 commit comments

Comments
 (0)