lkml.org 
[lkml]   [2023]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v1 4/6] thermal: intel: int340x: Rearrange int340x_thermal_read_trips()
Date
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(-)

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;



\
 
 \ /
  Last update: 2023-03-26 23:54    [W:0.077 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site