Re: [PATCH] thermal: intel: Use clamp() in pkg_temp_thermal_device_add()
From: Rafael J. Wysocki (Intel)
Date: Fri Nov 20 2026 - 12:20:26 EST
On Mon, Nov 16, 2026 at 1:17 PM Thorsten Blum <blum@xxxxxxxxxx> wrote:
>
> Use the simpler clamp() macro since the values are compatible.
>
> Signed-off-by: Thorsten Blum <blum@xxxxxxxxxx>
> ---
> drivers/thermal/intel/x86_pkg_temp_thermal.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/intel/x86_pkg_temp_thermal.c b/drivers/thermal/intel/x86_pkg_temp_thermal.c
> index 43fd5bdf1d8d..2b6265b80fe1 100644
> --- a/drivers/thermal/intel/x86_pkg_temp_thermal.c
> +++ b/drivers/thermal/intel/x86_pkg_temp_thermal.c
> @@ -327,7 +327,7 @@ static int pkg_temp_thermal_device_add(unsigned int cpu)
> if (!thres_count)
> return -ENODEV;
>
> - thres_count = clamp_val(thres_count, 0, MAX_NUMBER_OF_TRIPS);
> + thres_count = clamp(thres_count, 0, MAX_NUMBER_OF_TRIPS);
>
> tj_max = intel_tcc_get_tjmax(cpu);
> if (tj_max < 0)
Applied as 7.5 material, thanks!