thermal: intel: Clean up zone_trips[] initialization in int340x_thermal_zone_add()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Mon, 24 Feb 2025 19:49:28 +0000 (20:49 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 27 Feb 2025 20:18:42 +0000 (21:18 +0100)
'zone_trips[]' has just been allocated with kzalloc(), so .flags is
known to be 0, so assign THERMAL_TRIP_FLAG_RW_TEMP directly to it.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://patch.msgid.link/cceb7f8864c43f046cf1c19c3bbcc38a7a57adc5.1740426540.git.christophe.jaillet@wanadoo.fr
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c

index 2d672c4be3ce5fed8015ccf94f1ac077214acfdb..3d9efe69d5623dad4fcaa3330c3da1fe3b3b9cfa 100644 (file)
@@ -143,7 +143,7 @@ struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev,
        for (i = 0; i < trip_cnt; i++) {
                zone_trips[i].type = THERMAL_TRIP_PASSIVE;
                zone_trips[i].temperature = THERMAL_TEMP_INVALID;
-               zone_trips[i].flags |= THERMAL_TRIP_FLAG_RW_TEMP;
+               zone_trips[i].flags = THERMAL_TRIP_FLAG_RW_TEMP;
                zone_trips[i].priv = THERMAL_INT_TO_TRIP_PRIV(i);
        }