[v1,4/6] thermal: intel: int340x: Rearrange int340x_thermal_read_trips()

Message ID 3238718.44csPzL39Z@kreacher
State New
Headers
Series thermal: intel: int340x: Assorted cleanup changes |

Commit Message

Rafael J. Wysocki Jan. 24, 2023, 7:17 p.m. UTC
  From: Rafael J. Wysocki <rafael.j.wysocki@intel.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@intel.com>
---
 drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
  

Patch

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;