[PATCH] thermal: intel: powerclamp: Drop redundant clamp() in duration_set()

Thorsten Blum posted 1 patch 1 month, 2 weeks ago
drivers/thermal/intel/intel_powerclamp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] thermal: intel: powerclamp: Drop redundant clamp() in duration_set()
Posted by Thorsten Blum 1 month, 2 weeks ago
duration_set() rejects any new_duration outside the valid range before
the assignment, making the clamp() call redundant.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 drivers/thermal/intel/intel_powerclamp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/intel/intel_powerclamp.c b/drivers/thermal/intel/intel_powerclamp.c
index bd7fd98dc310..1efdaabc4bb8 100644
--- a/drivers/thermal/intel/intel_powerclamp.c
+++ b/drivers/thermal/intel/intel_powerclamp.c
@@ -94,7 +94,7 @@ static int duration_set(const char *arg, const struct kernel_param *kp)
 	}
 
 	mutex_lock(&powerclamp_lock);
-	duration = clamp(new_duration, 6ul, 25ul) * 1000;
+	duration = new_duration * 1000;
 	mutex_unlock(&powerclamp_lock);
 exit:
Re: [PATCH] thermal: intel: powerclamp: Drop redundant clamp() in duration_set()
Posted by Rafael J. Wysocki (Intel) 3 weeks, 3 days ago
On Sat, Aug 15, 2026 at 11:51 AM Thorsten Blum <thorsten.blum@linux.dev> wrote:
>
> duration_set() rejects any new_duration outside the valid range before
> the assignment, making the clamp() call redundant.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
>  drivers/thermal/intel/intel_powerclamp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/intel/intel_powerclamp.c b/drivers/thermal/intel/intel_powerclamp.c
> index bd7fd98dc310..1efdaabc4bb8 100644
> --- a/drivers/thermal/intel/intel_powerclamp.c
> +++ b/drivers/thermal/intel/intel_powerclamp.c
> @@ -94,7 +94,7 @@ static int duration_set(const char *arg, const struct kernel_param *kp)
>         }
>
>         mutex_lock(&powerclamp_lock);
> -       duration = clamp(new_duration, 6ul, 25ul) * 1000;
> +       duration = new_duration * 1000;
>         mutex_unlock(&powerclamp_lock);
>  exit:
>

Applied as 7.4 material, thanks!