Commit 4175a24f authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

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: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
parent cdfe09df
Loading
Loading
Loading
Loading
+10 −19
Original line number Diff line number Diff line
@@ -43,14 +43,6 @@
#define ACPI_THERMAL_MAX_ACTIVE		10
#define ACPI_THERMAL_MAX_LIMIT_STR_LEN	65

#define ACPI_TRIPS_PASSIVE	BIT(0)
#define ACPI_TRIPS_ACTIVE	BIT(1)
#define ACPI_TRIPS_DEVICES	BIT(2)

#define ACPI_TRIPS_THRESHOLDS	(ACPI_TRIPS_PASSIVE | ACPI_TRIPS_ACTIVE)

#define ACPI_TRIPS_INIT		(ACPI_TRIPS_THRESHOLDS | ACPI_TRIPS_DEVICES)

/*
 * This exception is thrown out in two cases:
 * 1.An invalid trip point becomes invalid or a valid trip point becomes invalid
@@ -58,9 +50,8 @@
 * 2.TODO: Devices listed in _PSL, _ALx, _TZD may change.
 *   We need to re-bind the cooling devices of a thermal zone when this occurs.
 */
#define ACPI_THERMAL_TRIPS_EXCEPTION(flags, tz, str) \
#define ACPI_THERMAL_TRIPS_EXCEPTION(tz, str) \
do { \
	if (flags != ACPI_TRIPS_INIT) \
	acpi_handle_info(tz->device->handle, \
			 "ACPI thermal trip point %s changed\n" \
			 "Please report to linux-acpi@vger.kernel.org\n", str); \
@@ -212,7 +203,7 @@ static void acpi_thermal_update_passive_trip(struct acpi_thermal *tz)

	update_acpi_thermal_trip_temp(acpi_trip, get_passive_temp(tz));
	if (!acpi_trip->valid)
		ACPI_THERMAL_TRIPS_EXCEPTION(ACPI_TRIPS_PASSIVE, tz, "state");
		ACPI_THERMAL_TRIPS_EXCEPTION(tz, "state");
}

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)
	}

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

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

	update_acpi_thermal_trip_temp(acpi_trip, THERMAL_TEMP_INVALID);
	ACPI_THERMAL_TRIPS_EXCEPTION(ACPI_TRIPS_PASSIVE, tz, "state");
	ACPI_THERMAL_TRIPS_EXCEPTION(tz, "state");
}

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)

	update_acpi_thermal_trip_temp(acpi_trip, get_active_temp(tz, index));
	if (!acpi_trip->valid)
		ACPI_THERMAL_TRIPS_EXCEPTION(ACPI_TRIPS_ACTIVE, tz, "state");
		ACPI_THERMAL_TRIPS_EXCEPTION(tz, "state");
}

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
	}

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

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

	update_acpi_thermal_trip_temp(acpi_trip, THERMAL_TEMP_INVALID);
	ACPI_THERMAL_TRIPS_EXCEPTION(ACPI_TRIPS_ACTIVE, tz, "state");
	ACPI_THERMAL_TRIPS_EXCEPTION(tz, "state");
}

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