lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3760530.kQq0lBPeGt@kreacher>
Date:   Tue, 12 Sep 2023 20:46:02 +0200
From:   "Rafael J. Wysocki" <rjw@...ysocki.net>
To:     Linux ACPI <linux-acpi@...r.kernel.org>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Linux PM <linux-pm@...r.kernel.org>,
        Zhang Rui <rui.zhang@...el.com>,
        Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
        Daniel Lezcano <daniel.lezcano@...aro.org>
Subject: [PATCH v1 8/9] ACPI: thermal: Drop redundant trip point flags

From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>

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 <rafael.j.wysocki@...el.com>
---
 drivers/acpi/thermal.c |   29 ++++++++++-------------------
 1 file changed, 10 insertions(+), 19 deletions(-)

Index: linux-pm/drivers/acpi/thermal.c
===================================================================
--- linux-pm.orig/drivers/acpi/thermal.c
+++ linux-pm/drivers/acpi/thermal.c
@@ -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,12 +50,11 @@
  * 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@...r.kernel.org\n", str); \
+	acpi_handle_info(tz->device->handle, \
+			 "ACPI thermal trip point %s changed\n" \
+			 "Please report to linux-acpi@...r.kernel.org\n", str); \
 } while (0)
 
 static int act;
@@ -212,7 +203,7 @@ static void acpi_thermal_update_passive_
 
 	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(struc
 	}
 
 	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_
 		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_t
 
 	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
 	}
 
 	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_d
 		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)



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ