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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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@xxxxxxxxx>
---
 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;
 






[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux