]> git.ipfire.org Git - thirdparty/linux.git/commit
thermal/debugfs: Clean up thermal_debug_update_temp()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 17 Apr 2024 13:10:34 +0000 (15:10 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 24 Apr 2024 18:43:06 +0000 (20:43 +0200)
commite271f9974d7e35a6eb05224660b2084035085173
tree90e18220c964a001f5c63b291da38fffc4e95f9e
parent0a293c77580581c4b058eb40287acadac6ffd14a
thermal/debugfs: Clean up thermal_debug_update_temp()

Notice that it is not necessary to compute tze in every iteration of the
for () loop in thermal_debug_update_temp() because it is the same for all
trips, so compute it once before the loop starts.

Also use a trip_stats local variable to make the code in that loop easier
to follow and move the trip_id variable definition into that loop because
it is not used elsewhere in the function.

While at it, change to order of local variable definitions in the function
to follow the reverse-xmas-tree pattern.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
drivers/thermal/thermal_debugfs.c