Skip to content

Commit 03a6d59

Browse files
committed
ACPI: thermal: Rename structure fields holding temperature in deci-Kelvin
Rename structure fields holding temperature values in deci-Kelvin so as to avoid temperature units confusion. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Daniel Lezcano <[email protected]>
1 parent c8f46f4 commit 03a6d59

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

drivers/acpi/thermal.c

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ MODULE_PARM_DESC(psv, "Disable or override all passive trip points.");
8282
static struct workqueue_struct *acpi_thermal_pm_queue;
8383

8484
struct acpi_thermal_trip {
85-
unsigned long temperature;
85+
unsigned long temp_dk;
8686
struct acpi_handle_list devices;
8787
};
8888

@@ -105,8 +105,8 @@ struct acpi_thermal_trips {
105105
struct acpi_thermal {
106106
struct acpi_device *device;
107107
acpi_bus_id name;
108-
unsigned long temperature;
109-
unsigned long last_temperature;
108+
unsigned long temp_dk;
109+
unsigned long last_temp_dk;
110110
unsigned long polling_frequency;
111111
volatile u8 zombie;
112112
struct acpi_thermal_trips trips;
@@ -131,16 +131,16 @@ static int acpi_thermal_get_temperature(struct acpi_thermal *tz)
131131
if (!tz)
132132
return -EINVAL;
133133

134-
tz->last_temperature = tz->temperature;
134+
tz->last_temp_dk = tz->temp_dk;
135135

136136
status = acpi_evaluate_integer(tz->device->handle, "_TMP", NULL, &tmp);
137137
if (ACPI_FAILURE(status))
138138
return -ENODEV;
139139

140-
tz->temperature = tmp;
140+
tz->temp_dk = tmp;
141141

142142
acpi_handle_debug(tz->device->handle, "Temperature is %lu dK\n",
143-
tz->temperature);
143+
tz->temp_dk);
144144

145145
return 0;
146146
}
@@ -175,7 +175,7 @@ static int acpi_thermal_temp(struct acpi_thermal *tz, int temp_deci_k)
175175

176176
static bool acpi_thermal_trip_valid(struct acpi_thermal_trip *acpi_trip)
177177
{
178-
return acpi_trip->temperature != THERMAL_TEMP_INVALID;
178+
return acpi_trip->temp_dk != THERMAL_TEMP_INVALID;
179179
}
180180

181181
static long get_passive_temp(struct acpi_thermal *tz)
@@ -197,7 +197,7 @@ static void acpi_thermal_update_passive_trip(struct acpi_thermal *tz)
197197
if (!acpi_thermal_trip_valid(acpi_trip) || psv > 0)
198198
return;
199199

200-
acpi_trip->temperature = get_passive_temp(tz);
200+
acpi_trip->temp_dk = get_passive_temp(tz);
201201
if (!acpi_thermal_trip_valid(acpi_trip))
202202
ACPI_THERMAL_TRIPS_EXCEPTION(tz, "state");
203203
}
@@ -244,7 +244,7 @@ static void acpi_thermal_update_trip_devices(struct acpi_thermal *tz, int index)
244244
return;
245245
}
246246

247-
acpi_trip->temperature = THERMAL_TEMP_INVALID;
247+
acpi_trip->temp_dk = THERMAL_TEMP_INVALID;
248248
ACPI_THERMAL_TRIPS_EXCEPTION(tz, "state");
249249
}
250250

@@ -278,7 +278,7 @@ static void acpi_thermal_update_active_trip(struct acpi_thermal *tz, int index)
278278
if (!acpi_thermal_trip_valid(acpi_trip))
279279
return;
280280

281-
acpi_trip->temperature = get_active_temp(tz, index);
281+
acpi_trip->temp_dk = get_active_temp(tz, index);
282282
if (!acpi_thermal_trip_valid(acpi_trip))
283283
ACPI_THERMAL_TRIPS_EXCEPTION(tz, "state");
284284
}
@@ -292,7 +292,7 @@ static int acpi_thermal_adjust_trip(struct thermal_trip *trip, void *data)
292292
return 0;
293293

294294
if (acpi_thermal_trip_valid(acpi_trip))
295-
trip->temperature = acpi_thermal_temp(tz, acpi_trip->temperature);
295+
trip->temperature = acpi_thermal_temp(tz, acpi_trip->temp_dk);
296296
else
297297
trip->temperature = THERMAL_TEMP_INVALID;
298298

@@ -447,11 +447,11 @@ static bool acpi_thermal_init_trip(struct acpi_thermal *tz, int index)
447447
if (!update_trip_devices(tz, acpi_trip, index, false))
448448
goto fail;
449449

450-
acpi_trip->temperature = temp;
450+
acpi_trip->temp_dk = temp;
451451
return true;
452452

453453
fail:
454-
acpi_trip->temperature = THERMAL_TEMP_INVALID;
454+
acpi_trip->temp_dk = THERMAL_TEMP_INVALID;
455455
return false;
456456
}
457457

@@ -472,7 +472,7 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
472472
}
473473

474474
while (++i < ACPI_THERMAL_MAX_ACTIVE)
475-
tz->trips.active[i].trip.temperature = THERMAL_TEMP_INVALID;
475+
tz->trips.active[i].trip.temp_dk = THERMAL_TEMP_INVALID;
476476

477477
return count;
478478
}
@@ -491,7 +491,7 @@ static int thermal_get_temp(struct thermal_zone_device *thermal, int *temp)
491491
if (result)
492492
return result;
493493

494-
*temp = deci_kelvin_to_millicelsius_with_offset(tz->temperature,
494+
*temp = deci_kelvin_to_millicelsius_with_offset(tz->temp_dk,
495495
tz->kelvin_offset);
496496
return 0;
497497
}
@@ -513,10 +513,10 @@ static int thermal_get_trend(struct thermal_zone_device *thermal,
513513

514514
switch (trip->type) {
515515
case THERMAL_TRIP_PASSIVE:
516-
t = tz->trips.passive.tc1 * (tz->temperature -
517-
tz->last_temperature) +
518-
tz->trips.passive.tc2 * (tz->temperature -
519-
acpi_trip->temperature);
516+
t = tz->trips.passive.tc1 * (tz->temp_dk -
517+
tz->last_temp_dk) +
518+
tz->trips.passive.tc2 * (tz->temp_dk -
519+
acpi_trip->temp_dk);
520520
if (t > 0)
521521
*trend = THERMAL_TREND_RAISING;
522522
else if (t < 0)
@@ -527,7 +527,7 @@ static int thermal_get_trend(struct thermal_zone_device *thermal,
527527
return 0;
528528

529529
case THERMAL_TRIP_ACTIVE:
530-
t = acpi_thermal_temp(tz, tz->temperature);
530+
t = acpi_thermal_temp(tz, tz->temp_dk);
531531
if (t <= trip->temperature)
532532
break;
533533

@@ -899,7 +899,7 @@ static int acpi_thermal_add(struct acpi_device *device)
899899
passive_delay = tz->trips.passive.tsp * 100;
900900

901901
trip->type = THERMAL_TRIP_PASSIVE;
902-
trip->temperature = acpi_thermal_temp(tz, acpi_trip->temperature);
902+
trip->temperature = acpi_thermal_temp(tz, acpi_trip->temp_dk);
903903
trip->priv = acpi_trip;
904904
trip++;
905905
}
@@ -911,7 +911,7 @@ static int acpi_thermal_add(struct acpi_device *device)
911911
break;
912912

913913
trip->type = THERMAL_TRIP_ACTIVE;
914-
trip->temperature = acpi_thermal_temp(tz, acpi_trip->temperature);
914+
trip->temperature = acpi_thermal_temp(tz, acpi_trip->temp_dk);
915915
trip->priv = acpi_trip;
916916
trip++;
917917
}
@@ -925,7 +925,7 @@ static int acpi_thermal_add(struct acpi_device *device)
925925
INIT_WORK(&tz->thermal_check_work, acpi_thermal_check_fn);
926926

927927
pr_info("%s [%s] (%ld C)\n", acpi_device_name(device),
928-
acpi_device_bid(device), deci_kelvin_to_celsius(tz->temperature));
928+
acpi_device_bid(device), deci_kelvin_to_celsius(tz->temp_dk));
929929

930930
result = acpi_dev_install_notify_handler(device, ACPI_DEVICE_NOTIFY,
931931
acpi_thermal_notify);

0 commit comments

Comments
 (0)