Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 993c870

Browse files
committed
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>
1 parent ea6a3c5 commit 993c870

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/thermal/thermal_debugfs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,7 @@ static struct tz_episode *thermal_debugfs_tz_event_alloc(struct thermal_zone_dev
563563
tze->duration = KTIME_MIN;
564564

565565
for (i = 0; i < tz->num_trips; i++) {
566+
tze->trip_stats[i].trip_temp = THERMAL_TEMP_INVALID;
566567
tze->trip_stats[i].min = INT_MAX;
567568
tze->trip_stats[i].max = INT_MIN;
568569
}
@@ -818,7 +819,7 @@ static int tze_seq_show(struct seq_file *s, void *v)
818819
trip_stats = &tze->trip_stats[trip_id];
819820

820821
/* Skip trips without any stats. */
821-
if (trip_stats->min > trip_stats->max)
822+
if (trip_stats->trip_temp == THERMAL_TEMP_INVALID)
822823
continue;
823824

824825
if (trip->type == THERMAL_TRIP_PASSIVE)

0 commit comments

Comments
 (0)