@@ -81,19 +81,18 @@ static struct workqueue_struct *acpi_thermal_pm_queue;
81
81
82
82
struct acpi_thermal_trip {
83
83
unsigned long temperature ;
84
+ struct acpi_handle_list devices ;
84
85
};
85
86
86
87
struct acpi_thermal_passive {
87
88
struct acpi_thermal_trip trip ;
88
- struct acpi_handle_list devices ;
89
89
unsigned long tc1 ;
90
90
unsigned long tc2 ;
91
91
unsigned long tsp ;
92
92
};
93
93
94
94
struct acpi_thermal_active {
95
95
struct acpi_thermal_trip trip ;
96
- struct acpi_handle_list devices ;
97
96
};
98
97
99
98
struct acpi_thermal_trips {
@@ -205,6 +204,7 @@ static void acpi_thermal_update_passive_trip(struct acpi_thermal *tz)
205
204
206
205
static bool update_passive_devices (struct acpi_thermal * tz , bool compare )
207
206
{
207
+ struct acpi_thermal_trip * acpi_trip = & tz -> trips .passive .trip ;
208
208
struct acpi_handle_list devices ;
209
209
acpi_status status ;
210
210
@@ -217,10 +217,10 @@ static bool update_passive_devices(struct acpi_thermal *tz, bool compare)
217
217
return false;
218
218
}
219
219
220
- if (compare && memcmp (& tz -> trips . passive . devices , & devices , sizeof (devices )))
220
+ if (compare && memcmp (& acpi_trip -> devices , & devices , sizeof (devices )))
221
221
ACPI_THERMAL_TRIPS_EXCEPTION (tz , "device" );
222
222
223
- memcpy (& tz -> trips . passive . devices , & devices , sizeof (devices ));
223
+ memcpy (& acpi_trip -> devices , & devices , sizeof (devices ));
224
224
return true;
225
225
}
226
226
@@ -276,6 +276,7 @@ static void acpi_thermal_update_active_trip(struct acpi_thermal *tz, int index)
276
276
static bool update_active_devices (struct acpi_thermal * tz , int index , bool compare )
277
277
{
278
278
char method [] = { '_' , 'A' , 'L' , '0' + index , '\0' };
279
+ struct acpi_thermal_trip * acpi_trip = & tz -> trips .active [index ].trip ;
279
280
struct acpi_handle_list devices ;
280
281
acpi_status status ;
281
282
@@ -289,10 +290,10 @@ static bool update_active_devices(struct acpi_thermal *tz, int index, bool compa
289
290
return false;
290
291
}
291
292
292
- if (compare && memcmp (& tz -> trips . active [ index ]. devices , & devices , sizeof (devices )))
293
+ if (compare && memcmp (& acpi_trip -> devices , & devices , sizeof (devices )))
293
294
ACPI_THERMAL_TRIPS_EXCEPTION (tz , "device" );
294
295
295
- memcpy (& tz -> trips . active [ index ]. devices , & devices , sizeof (devices ));
296
+ memcpy (& acpi_trip -> devices , & devices , sizeof (devices ));
296
297
return true;
297
298
}
298
299
@@ -602,6 +603,7 @@ static int acpi_thermal_cooling_device_cb(struct thermal_zone_device *thermal,
602
603
{
603
604
struct acpi_device * device = cdev -> devdata ;
604
605
struct acpi_thermal * tz = thermal_zone_device_priv (thermal );
606
+ struct acpi_thermal_trip * acpi_trip ;
605
607
struct acpi_device * dev ;
606
608
acpi_handle handle ;
607
609
int i ;
@@ -615,10 +617,11 @@ static int acpi_thermal_cooling_device_cb(struct thermal_zone_device *thermal,
615
617
if (tz -> trips .hot_valid )
616
618
trip ++ ;
617
619
618
- if (acpi_thermal_trip_valid (& tz -> trips .passive .trip )) {
620
+ acpi_trip = & tz -> trips .passive .trip ;
621
+ if (acpi_thermal_trip_valid (acpi_trip )) {
619
622
trip ++ ;
620
- for (i = 0 ; i < tz -> trips . passive . devices .count ; i ++ ) {
621
- handle = tz -> trips . passive . devices .handles [i ];
623
+ for (i = 0 ; i < acpi_trip -> devices .count ; i ++ ) {
624
+ handle = acpi_trip -> devices .handles [i ];
622
625
dev = acpi_fetch_acpi_dev (handle );
623
626
if (dev != device )
624
627
continue ;
@@ -640,12 +643,13 @@ static int acpi_thermal_cooling_device_cb(struct thermal_zone_device *thermal,
640
643
}
641
644
642
645
for (i = 0 ; i < ACPI_THERMAL_MAX_ACTIVE ; i ++ ) {
643
- if (!acpi_thermal_trip_valid (& tz -> trips .active [i ].trip ))
646
+ acpi_trip = & tz -> trips .active [i ].trip ;
647
+ if (!acpi_thermal_trip_valid (acpi_trip ))
644
648
break ;
645
649
646
650
trip ++ ;
647
- for (j = 0 ; j < tz -> trips . active [ i ]. devices .count ; j ++ ) {
648
- handle = tz -> trips . active [ i ]. devices .handles [j ];
651
+ for (j = 0 ; j < acpi_trip -> devices .count ; j ++ ) {
652
+ handle = acpi_trip -> devices .handles [j ];
649
653
dev = acpi_fetch_acpi_dev (handle );
650
654
if (dev != device )
651
655
continue ;
@@ -1037,11 +1041,13 @@ static int acpi_thermal_resume(struct device *dev)
1037
1041
return - EINVAL ;
1038
1042
1039
1043
for (i = 0 ; i < ACPI_THERMAL_MAX_ACTIVE ; i ++ ) {
1040
- if (!acpi_thermal_trip_valid (& tz -> trips .active [i ].trip ))
1044
+ struct acpi_thermal_trip * acpi_trip = & tz -> trips .active [i ].trip ;
1045
+
1046
+ if (!acpi_thermal_trip_valid (acpi_trip ))
1041
1047
break ;
1042
1048
1043
- for (j = 0 ; j < tz -> trips . active [ i ]. devices .count ; j ++ ) {
1044
- acpi_bus_update_power (tz -> trips . active [ i ]. devices .handles [j ],
1049
+ for (j = 0 ; j < acpi_trip -> devices .count ; j ++ ) {
1050
+ acpi_bus_update_power (acpi_trip -> devices .handles [j ],
1045
1051
& power_state );
1046
1052
}
1047
1053
}
0 commit comments