[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3238718.44csPzL39Z@kreacher>
Date: Tue, 24 Jan 2023 20:17:09 +0100
From: "Rafael J. Wysocki" <rjw@...ysocki.net>
To: Linux PM <linux-pm@...r.kernel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Linux ACPI <linux-acpi@...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 4/6] thermal: intel: int340x: Rearrange int340x_thermal_read_trips()
From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
Use local variables trips and adev to store the addresses of the given
thermal zone's trip point table and ACPI device, respectively, and use
them to shorten some code lines.
No intentional functional impact.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
---
drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
Index: linux-pm/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
===================================================================
--- linux-pm.orig/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
+++ linux-pm/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
@@ -66,25 +66,27 @@ static struct thermal_zone_device_ops in
int int340x_thermal_read_trips(struct int34x_thermal_zone *int34x_zone)
{
+ struct thermal_trip *trips = int34x_zone->trips;
+ struct acpi_device *adev = int34x_zone->adev;
int trip_cnt;
int i, ret;
trip_cnt = int34x_zone->aux_trip_nr;
- ret = thermal_acpi_trip_critical(int34x_zone->adev, &int34x_zone->trips[trip_cnt]);
+ ret = thermal_acpi_trip_critical(adev, &trips[trip_cnt]);
if (!ret)
trip_cnt++;
- ret = thermal_acpi_trip_hot(int34x_zone->adev, &int34x_zone->trips[trip_cnt]);
+ ret = thermal_acpi_trip_hot(adev, &trips[trip_cnt]);
if (!ret)
trip_cnt++;
- ret = thermal_acpi_trip_passive(int34x_zone->adev, &int34x_zone->trips[trip_cnt]);
+ ret = thermal_acpi_trip_passive(adev, &trips[trip_cnt]);
if (!ret)
trip_cnt++;
for (i = 0; i < INT340X_THERMAL_MAX_ACT_TRIP_COUNT; i++) {
- ret = thermal_acpi_trip_active(int34x_zone->adev, i, &int34x_zone->trips[trip_cnt]);
+ ret = thermal_acpi_trip_active(adev, i, &trips[trip_cnt]);
if (ret)
break;
Powered by blists - more mailing lists