diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2024-10-16 14:21:42 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2024-10-24 18:15:06 +0300 |
commit | c12629f832d21e2a87f014174387e605661e91c7 (patch) | |
tree | e90bc2dbd4b80e47557a6bbe72afb2d5367cdfd6 /drivers/cdx/controller/cdx_controller.c | |
parent | 7569406e95f2353070d88ebc88e8c13698542317 (diff) | |
download | linux-c12629f832d21e2a87f014174387e605661e91c7.tar.xz |
thermal: core: Build sorted lists instead of sorting them later
Since it is not expected that multiple trip points will be crossed
in one go very often (if this happens, there are too many trip points
in the given thermal zone or they are checked too rarely), quite likely
it is more efficient to build a sorted list of crossed trip points than
to put them on an unsorted list and sort it later.
Moreover, trip points are often sorted in ascending temperature order
during thermal zone registration, so building a sorted list out of
them is quite straightforward and relatively inexpensive.
Accordingly, make handle_thermal_trip() maintain list ordering when
adding trip points to the lists and get rid of separate list sorting
in __thermal_zone_device_update().
No intentional functional impact.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Link: https://patch.msgid.link/4930656.GXAFRqVoOG@rjwysocki.net
Diffstat (limited to 'drivers/cdx/controller/cdx_controller.c')
0 files changed, 0 insertions, 0 deletions