Re: [PATCH] thermal: intel: powerclamp: Use guard(mutex) to simplify the code

From: Thorsten Blum

Date: Wed Nov 11 2026 - 07:40:24 EST


On Wed, Nov 11, 2026 at 12:16:08AM +0100, Thorsten Blum wrote:
> Use guard(mutex) to replace explicit mutex_{lock,unlock}() calls.
>
> Simplify the return paths and drop redundant ret initializations in
> duration_set(), window_size_set(), and powerclamp_set_cur_state().
>
> Signed-off-by: Thorsten Blum <blum@xxxxxxxxxx>
> ---
> drivers/thermal/intel/intel_powerclamp.c | 71 ++++++++++--------------
> 1 file changed, 28 insertions(+), 43 deletions(-)

I'll send a v2 after taking Sashiko's feedback into account:
https://sashiko.dev/#/patchset/20261110231611.7159-2-blum%40kernel.org

And this patch should only be applied after the following fix:
https://lore.kernel.org/r/20261111121225.70218-3-blum@xxxxxxxxxx/

Thanks,
Thorsten