OSDN Git Service

ACPI: thermal: Adjust critical.flags.valid check
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 5 Dec 2022 18:56:14 +0000 (19:56 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 7 Dec 2022 17:06:00 +0000 (18:06 +0100)
It is not necessary to compare critical.flags.valid to 1 in
acpi_thermal_trips_update() and doing so is also inconsistent with
other similar checks in that code, so simply check if the flag is
not 0 instead.

No expected functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/thermal.c

index 40b0705..2e14283 100644 (file)
@@ -291,7 +291,7 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
                                          "Found critical threshold [%lu]\n",
                                          tz->trips.critical.temperature);
                }
-               if (tz->trips.critical.flags.valid == 1) {
+               if (tz->trips.critical.flags.valid) {
                        if (crt == -1) {
                                tz->trips.critical.flags.valid = 0;
                        } else if (crt > 0) {