thermal: core: Fix list sorting in __thermal_zone_device_update()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 8 Jul 2024 15:16:00 +0000 (17:16 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 8 Jul 2024 15:24:22 +0000 (17:24 +0200)
commit94eacc1c583dd2ba51a2158fb13285f5dc42714b
treea050794e028d262c2a6b0ab0881fa0520267f7d0
parenta8a261774466d8691e555ea674c193bb1b09edab
thermal: core: Fix list sorting in __thermal_zone_device_update()

The order in which lists are sorted in __thermal_zone_device_update()
is reverse with respect to what it should be due to a mistake in
thermal_trip_notify_cmp().

Fix it and observe that it is not necessary to sort the lists in
different orders.  They can both be sorted in ascending order if
way_down_list is walked in reverse order which allows the code to
be slightly more straightforward (and less prone to silly mistakes).

Fixes: 7454f2c42cce ("thermal: core: Sort trip point crossing notifications by temperature")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/12481676.O9o76ZdvQC@rjwysocki.net
drivers/thermal/thermal_core.c