+#define for_each_trip_reverse(__tz, __trip) \
+ for (__trip = &__tz->trips[__tz->num_trips - 1]; __trip >= __tz->trips ; __trip--)
+
void __thermal_zone_set_trips(struct thermal_zone_device *tz);
int thermal_zone_trip_id(const struct thermal_zone_device *tz,
const struct thermal_trip *trip);
--
Generally speaking, this is a matter of getting alignment on the
expectations between the kernel and user space.
It looks like user space expects to get the notifications in the order
of either growing or falling temperatures, depending on the direction
of the temperature change. Ordering the trips in the kernel is not
practical, but the notifications can be ordered in principle. Is this
what you'd like to do?
Or can user space be bothered with recognizing that it may get the
notifications for different trips out of order?