Skip to contentSkip to conversation

Do copy passive devices only if they are valid

PATCH In review Thomas Renninger 2 participants 2 messages Mar 6, 2008 – Mar 7, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Do copy passive devices only if they are valid

Warn user about a BIOS bug in recent asus boards

Do copy passive devices only if they are valid.

---
 drivers/acpi/thermal.c |   20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
drivers/acpi/thermal.c +11 -9
Index: linux-2.6.24/drivers/acpi/thermal.c
===================================================================
@@ -440,16 +440,18 @@ static int acpi_thermal_trips_update(str
 		memset(&devices, 0, sizeof(struct acpi_handle_list));
 		status = acpi_evaluate_reference(tz->device->handle, "_PSL",
 							NULL, &devices);
-		if (ACPI_FAILURE(status))
-			tz->trips.passive.flags.valid = 0;
-		else
+		if (ACPI_SUCCESS(status)) {
 			tz->trips.passive.flags.valid = 1;
-
-		if (memcmp(&tz->trips.passive.devices, &devices,
-				sizeof(struct acpi_handle_list))) {
-			memcpy(&tz->trips.passive.devices, &devices,
-				sizeof(struct acpi_handle_list));
-			ACPI_THERMAL_TRIPS_EXCEPTION(flag, "device");
+			if (memcmp(&tz->trips.passive.devices, &devices,
+				   sizeof(struct acpi_handle_list))) {
+				memcpy(&tz->trips.passive.devices, &devices,
+				       sizeof(struct acpi_handle_list));
+				ACPI_THERMAL_TRIPS_EXCEPTION(flag, "device");
+			}
+		} else {
+			tz->trips.passive.flags.valid = 0;
+			ACPI_EXCEPTION((AE_INFO, status, "Invalid passiv trip"
+					" point\n"));
 		}
 	}
 	if ((flag & ACPI_TRIPS_PASSIVE) || (flag & ACPI_TRIPS_DEVICES)) {
reviewer
#1 lore raw
Quoted 3 lines · Thomas Renninger

Warn user about a BIOS bug in recent asus boards

Do copy passive devices only if they are valid.

thanks,
rui

Quoted 50 lines
---
 drivers/acpi/thermal.c |   20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

Index: linux-2.6.24/drivers/acpi/thermal.c
===================================================================

drivers/acpi/thermal.c +4 -9
@@ -440,16 +440,18 @@ static int acpi_thermal_trips_update(str
                memset(&devices, 0, sizeof(struct acpi_handle_list));
                status = acpi_evaluate_reference(tz->device->handle,
 "_PSL",
                                                        NULL,
 &devices);
-               if (ACPI_FAILURE(status))
-                       tz->trips.passive.flags.valid = 0;
-               else
+               if (ACPI_SUCCESS(status)) {
                        tz->trips.passive.flags.valid = 1;
-
-               if (memcmp(&tz->trips.passive.devices, &devices,
-                               sizeof(struct acpi_handle_list))) {
-                       memcpy(&tz->trips.passive.devices, &devices,
-                               sizeof(struct acpi_handle_list));
-                       ACPI_THERMAL_TRIPS_EXCEPTION(flag, "device");
+                       if (memcmp(&tz->trips.passive.devices,
 &devices,
+                                  sizeof(struct acpi_handle_list))) {
+                               memcpy(&tz->trips.passive.devices,

&devices,
+ sizeof(struct
acpi_handle_list));
+ ACPI_THERMAL_TRIPS_EXCEPTION(flag,
"device");

drivers/acpi/thermal.c +4 -0
+                       }
+               } else {
+                       tz->trips.passive.flags.valid = 0;
+                       ACPI_EXCEPTION((AE_INFO, status, "Invalid

passiv trip"

+                                       " point\n"));
                }
        }
        if ((flag & ACPI_TRIPS_PASSIVE) || (flag &

ACPI_TRIPS_DEVICES)) {