Re: [PATCH v2 16/16] thermal/traces: Replace the thermal zone structure parameter with the field value

From: Daniel Lezcano
Date: Wed Feb 22 2023 - 15:02:20 EST


On 22/02/2023 20:51, Rafael J. Wysocki wrote:
On Tue, Feb 21, 2023 at 7:08 PM Daniel Lezcano
<daniel.lezcano@xxxxxxxxxx> wrote:

In the work of the thermal zone device self-encapsulation, let's pass
the field value instead of dereferencing them in the traces which
force us to export publicly the thermal_zone_device structure.

No fonctionnal change intended.

Signed-off-by: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>
---
drivers/thermal/gov_fair_share.c | 2 +-
drivers/thermal/gov_power_allocator.c | 4 ++--
drivers/thermal/gov_step_wise.c | 2 +-
drivers/thermal/thermal_core.c | 5 ++--
include/trace/events/thermal.h | 24 +++++++++----------
.../trace/events/thermal_power_allocator.h | 12 +++++-----
6 files changed, 25 insertions(+), 24 deletions(-)

diff --git a/drivers/thermal/gov_fair_share.c b/drivers/thermal/gov_fair_share.c
index aad7d5fe3a14..e6c21abaaa80 100644
--- a/drivers/thermal/gov_fair_share.c
+++ b/drivers/thermal/gov_fair_share.c
@@ -35,7 +35,7 @@ static int get_trip_level(struct thermal_zone_device *tz)
* point, in which case, trip_point = count - 1
*/
if (count > 0)
- trace_thermal_zone_trip(tz, count - 1, trip.type);
+ trace_thermal_zone_trip(tz->type, tz->id, count - 1, trip.type);

Haven't you introduced an accessor for tz->id in this series? Why not
use it here?

And there can be an analogous accessor for tz->type.

If there are accessors like that, they should be used consistently
everywhere as applicable IMO.

governors are part of the thermal core code, so they are authorized to access the thermal structure internals, that is why they are not passing through the accessors.


--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog