thermal: trip: Simplify computing trip indices
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 12 Oct 2023 18:25:06 +0000 (20:25 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 20 Oct 2023 17:25:22 +0000 (19:25 +0200)
commit78869767f2ad3a98d2c830b718a503d8b0a94b26
treecb6e8a3834125e710eefdadb9d0e34d1b4e04991
parenta26b452e836e39223915adc41867441f3f0b372b
thermal: trip: Simplify computing trip indices

A trip index can be computed right away as a difference between the
value of a trip pointer pointing to the given trip object and the
start of the trips[] table in the given thermal zone, so change
thermal_zone_trip_id() accordingly.

No intentional functional impact (except for some speedup).

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