[PATCH] thermal: intel: Slighly simplify duration_set()
From: Christophe JAILLET
Date: Wed Sep 02 2026 - 13:27:29 EST
there is no need to call clamp here(). The same tests have already been
performed a few lines above, and there is a "goto exit;" if outside of the
range.
While at it, also remove an un-needed initialization of 'ret'.
Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
---
Based on my testing, gcc is not smart enough to get rid of the redundnat
tests by itself.
This patch is compile tested only
---
drivers/thermal/intel/intel_powerclamp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/thermal/intel/intel_powerclamp.c b/drivers/thermal/intel/intel_powerclamp.c
index bd7fd98dc310..ba9c4a1224ca 100644
--- a/drivers/thermal/intel/intel_powerclamp.c
+++ b/drivers/thermal/intel/intel_powerclamp.c
@@ -80,7 +80,7 @@ static unsigned int window_size;
static int duration_set(const char *arg, const struct kernel_param *kp)
{
- int ret = 0;
+ int ret;
unsigned long new_duration;
ret = kstrtoul(arg, 10, &new_duration);
@@ -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:
--
2.55.0