Re: [PATCH v2 01/11] thermal: core: Add and use thermal zone guard

From: Lukasz Luba
Date: Tue Oct 22 2024 - 17:01:45 EST


Hi Rafael,

On 10/10/24 23:05, Rafael J. Wysocki wrote:
From: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>

Add and use a guard for thermal zone locking.

This allows quite a few error code paths to be simplified among
other things and brings in a noticeable code size reduction for
a good measure.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
---

This is a new iteration of

https://lore.kernel.org/linux-pm/3241904.5fSG56mABF@xxxxxxxxxxxxx/

that has been combined with

https://lore.kernel.org/linux-pm/4613601.LvFx2qVVIh@xxxxxxxxxxxxx/

and rebased on top of

https://lore.kernel.org/linux-pm/12549318.O9o76ZdvQC@xxxxxxxxxxxxx/

and

https://lore.kernel.org/linux-pm/2215082.irdbgypaU6@xxxxxxxxxxxxx/

---
drivers/thermal/thermal_core.c | 61 +++++++---------------------
drivers/thermal/thermal_core.h | 4 +
drivers/thermal/thermal_debugfs.c | 25 +++++++----
drivers/thermal/thermal_helpers.c | 17 ++-----
drivers/thermal/thermal_hwmon.c | 5 --
drivers/thermal/thermal_netlink.c | 21 ++-------
drivers/thermal/thermal_sysfs.c | 81 ++++++++++++++++----------------------
drivers/thermal/thermal_trip.c | 8 ---
8 files changed, 86 insertions(+), 136 deletions(-)



[snip]

Surprise, how the code can look smaller using that
style with 'guard'.

Reviewed-by: Lukasz Luba <lukasz.luba@xxxxxxx>