Skip to content

Commit 4175a24

Browse files
committed
ACPI: thermal: Drop redundant trip point flags
Trip point flags previously used by the driver need not be used any more after the preceding changes, so drop them and adjust the code accordingly. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <[email protected]> Reviewed-by: Daniel Lezcano <[email protected]>
1 parent cdfe09d commit 4175a24

File tree

1 file changed

+10
-19
lines changed

1 file changed

+10
-19
lines changed

drivers/acpi/thermal.c

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -43,27 +43,18 @@
4343
#define ACPI_THERMAL_MAX_ACTIVE 10
4444
#define ACPI_THERMAL_MAX_LIMIT_STR_LEN 65
4545

46-
#define ACPI_TRIPS_PASSIVE BIT(0)
47-
#define ACPI_TRIPS_ACTIVE BIT(1)
48-
#define ACPI_TRIPS_DEVICES BIT(2)
49-
50-
#define ACPI_TRIPS_THRESHOLDS (ACPI_TRIPS_PASSIVE | ACPI_TRIPS_ACTIVE)
51-
52-
#define ACPI_TRIPS_INIT (ACPI_TRIPS_THRESHOLDS | ACPI_TRIPS_DEVICES)
53-
5446
/*
5547
* This exception is thrown out in two cases:
5648
* 1.An invalid trip point becomes invalid or a valid trip point becomes invalid
5749
* when re-evaluating the AML code.
5850
* 2.TODO: Devices listed in _PSL, _ALx, _TZD may change.
5951
* We need to re-bind the cooling devices of a thermal zone when this occurs.
6052
*/
61-
#define ACPI_THERMAL_TRIPS_EXCEPTION(flags, tz, str) \
53+
#define ACPI_THERMAL_TRIPS_EXCEPTION(tz, str) \
6254
do { \
63-
if (flags != ACPI_TRIPS_INIT) \
64-
acpi_handle_info(tz->device->handle, \
65-
"ACPI thermal trip point %s changed\n" \
66-
"Please report to [email protected]\n", str); \
55+
acpi_handle_info(tz->device->handle, \
56+
"ACPI thermal trip point %s changed\n" \
57+
"Please report to [email protected]\n", str); \
6758
} while (0)
6859

6960
static int act;
@@ -212,7 +203,7 @@ static void acpi_thermal_update_passive_trip(struct acpi_thermal *tz)
212203

213204
update_acpi_thermal_trip_temp(acpi_trip, get_passive_temp(tz));
214205
if (!acpi_trip->valid)
215-
ACPI_THERMAL_TRIPS_EXCEPTION(ACPI_TRIPS_PASSIVE, tz, "state");
206+
ACPI_THERMAL_TRIPS_EXCEPTION(tz, "state");
216207
}
217208

218209
static bool update_passive_devices(struct acpi_thermal *tz, bool compare)
@@ -230,7 +221,7 @@ static bool update_passive_devices(struct acpi_thermal *tz, bool compare)
230221
}
231222

232223
if (compare && memcmp(&tz->trips.passive.devices, &devices, sizeof(devices)))
233-
ACPI_THERMAL_TRIPS_EXCEPTION(ACPI_TRIPS_PASSIVE, tz, "device");
224+
ACPI_THERMAL_TRIPS_EXCEPTION(tz, "device");
234225

235226
memcpy(&tz->trips.passive.devices, &devices, sizeof(devices));
236227
return true;
@@ -247,7 +238,7 @@ static void acpi_thermal_update_passive_devices(struct acpi_thermal *tz)
247238
return;
248239

249240
update_acpi_thermal_trip_temp(acpi_trip, THERMAL_TEMP_INVALID);
250-
ACPI_THERMAL_TRIPS_EXCEPTION(ACPI_TRIPS_PASSIVE, tz, "state");
241+
ACPI_THERMAL_TRIPS_EXCEPTION(tz, "state");
251242
}
252243

253244
static long get_active_temp(struct acpi_thermal *tz, int index)
@@ -282,7 +273,7 @@ static void acpi_thermal_update_active_trip(struct acpi_thermal *tz, int index)
282273

283274
update_acpi_thermal_trip_temp(acpi_trip, get_active_temp(tz, index));
284275
if (!acpi_trip->valid)
285-
ACPI_THERMAL_TRIPS_EXCEPTION(ACPI_TRIPS_ACTIVE, tz, "state");
276+
ACPI_THERMAL_TRIPS_EXCEPTION(tz, "state");
286277
}
287278

288279
static bool update_active_devices(struct acpi_thermal *tz, int index, bool compare)
@@ -302,7 +293,7 @@ static bool update_active_devices(struct acpi_thermal *tz, int index, bool compa
302293
}
303294

304295
if (compare && memcmp(&tz->trips.active[index].devices, &devices, sizeof(devices)))
305-
ACPI_THERMAL_TRIPS_EXCEPTION(ACPI_TRIPS_ACTIVE, tz, "device");
296+
ACPI_THERMAL_TRIPS_EXCEPTION(tz, "device");
306297

307298
memcpy(&tz->trips.active[index].devices, &devices, sizeof(devices));
308299
return true;
@@ -319,7 +310,7 @@ static void acpi_thermal_update_active_devices(struct acpi_thermal *tz, int inde
319310
return;
320311

321312
update_acpi_thermal_trip_temp(acpi_trip, THERMAL_TEMP_INVALID);
322-
ACPI_THERMAL_TRIPS_EXCEPTION(ACPI_TRIPS_ACTIVE, tz, "state");
313+
ACPI_THERMAL_TRIPS_EXCEPTION(tz, "state");
323314
}
324315

325316
static int acpi_thermal_adjust_trip(struct thermal_trip *trip, void *data)

0 commit comments

Comments
 (0)