diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2024-05-28 16:57:13 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2024-06-11 21:04:21 +0200 |
commit | 993c87047ddebb9cf922c489199d3a402a440979 (patch) | |
tree | 5969163c76fe7867c7ae86d0f4bf972fb3d9fe8d /drivers/thermal | |
parent | ea6a3c52021e552d904d0b1b67ef695bc5c3a54a (diff) | |
download | lwn-993c87047ddebb9cf922c489199d3a402a440979.tar.gz lwn-993c87047ddebb9cf922c489199d3a402a440979.zip |
thermal/debugfs: Adjust check for trips without statistics in tze_seq_show()
Initialize the trip_temp field in struct trip_stats to
THERMAL_TEMP_INVALID and adjust the check for trips without
statistics in tze_seq_show() to look at that field instead of
comparing min and max.
This will mostly be useful to simplify subsequent changes.
No intentional functional impact.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Diffstat (limited to 'drivers/thermal')
-rw-r--r-- | drivers/thermal/thermal_debugfs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/thermal/thermal_debugfs.c b/drivers/thermal/thermal_debugfs.c index ee9fc627ec81..5f9e5e9d403c 100644 --- a/drivers/thermal/thermal_debugfs.c +++ b/drivers/thermal/thermal_debugfs.c @@ -563,6 +563,7 @@ static struct tz_episode *thermal_debugfs_tz_event_alloc(struct thermal_zone_dev tze->duration = KTIME_MIN; for (i = 0; i < tz->num_trips; i++) { + tze->trip_stats[i].trip_temp = THERMAL_TEMP_INVALID; tze->trip_stats[i].min = INT_MAX; tze->trip_stats[i].max = INT_MIN; } @@ -818,7 +819,7 @@ static int tze_seq_show(struct seq_file *s, void *v) trip_stats = &tze->trip_stats[trip_id]; /* Skip trips without any stats. */ - if (trip_stats->min > trip_stats->max) + if (trip_stats->trip_temp == THERMAL_TEMP_INVALID) continue; if (trip->type == THERMAL_TRIP_PASSIVE) |