public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Linux ACPI <linux-acpi@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Linux PM <linux-pm@vger.kernel.org>,
	Zhang Rui <rui.zhang@intel.com>,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>
Subject: [PATCH v1 8/9] ACPI: thermal: Drop redundant trip point flags
Date: Tue, 12 Sep 2023 20:46:02 +0200	[thread overview]
Message-ID: <3760530.kQq0lBPeGt@kreacher> (raw)
In-Reply-To: <5708760.DvuYhMxLoT@kreacher>

From: Rafael J. Wysocki <rafael.j.wysocki@intel.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@intel.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@vger.kernel.org\n", str); \
+	acpi_handle_info(tz->device->handle, \
+			 "ACPI thermal trip point %s changed\n" \
+			 "Please report to linux-acpi@vger.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)




  parent reply	other threads:[~2023-09-12 18:47 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-12 18:33 [PATCH v1 0/9] ACPI: thermal: Removal of redundant data and cleanup Rafael J. Wysocki
2023-09-12 18:35 ` [PATCH v1 1/9] ACPI: thermal: Simplify initialization of critical and hot trips Rafael J. Wysocki
2023-09-25 15:20   ` Daniel Lezcano
2023-09-25 17:12     ` Rafael J. Wysocki
2023-09-12 18:36 ` [PATCH v1 2/9] ACPI: thermal: Fold acpi_thermal_get_info() into its caller Rafael J. Wysocki
2023-09-25 15:31   ` Daniel Lezcano
2023-09-12 18:37 ` [PATCH v1 3/9] ACPI: thermal: Determine the number of trip points earlier Rafael J. Wysocki
2023-09-25 15:59   ` Daniel Lezcano
2023-09-12 18:39 ` [PATCH v1 4/9] ACPI: thermal: Create and populate trip points table earlier Rafael J. Wysocki
2023-09-25 16:29   ` Daniel Lezcano
2023-09-12 18:41 ` [PATCH v1 5/9] ACPI: thermal: Simplify critical and hot trips representation Rafael J. Wysocki
2023-09-25 16:33   ` Daniel Lezcano
2023-09-12 18:43 ` [PATCH v1 6/9] ACPI: thermal: Untangle initialization and updates of the passive trip Rafael J. Wysocki
2023-09-26 11:30   ` Daniel Lezcano
2023-09-12 18:43 ` [PATCH v1 7/9] ACPI: thermal: Untangle initialization and updates of active trips Rafael J. Wysocki
2023-09-20 13:06   ` Rafael J. Wysocki
2023-09-26 13:04   ` Daniel Lezcano
2023-09-12 18:46 ` Rafael J. Wysocki [this message]
2023-09-26 13:46   ` [PATCH v1 8/9] ACPI: thermal: Drop redundant trip point flags Daniel Lezcano
2023-09-12 18:47 ` [PATCH v1 9/9] ACPI: thermal: Drop valid flag from struct acpi_thermal_trip Rafael J. Wysocki
2023-09-21  7:36   ` Daniel Lezcano
2023-09-26 13:47   ` Daniel Lezcano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3760530.kQq0lBPeGt@kreacher \
    --to=rjw@rjwysocki.net \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=srinivas.pandruvada@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox