thermal: intel: powerclamp: Drop redundant clamp() in duration_set()
PATCH 1/1 thermal: intel: powerclamp: Drop redundant clamp() in duration_set()
duration_set() rejects any new_duration outside the valid range before the assignment, making the clamp() call redundant.
Signed-off-by Thorsten Blum <[email protected]>
--- drivers/thermal/intel/intel_powerclamp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/intel/intel_powerclamp.c +1 -1
@@ -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:
Quoted 14 lines · Thorsten Blum
duration_set()rejects anynew_durationoutside the valid range before the assignment, making theclamp()call redundant.Signed-off-by Thorsten Blum <[email protected]>--- drivers/thermal/intel/intel_powerclamp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/thermal/intel/intel_powerclamp.c +0
-0
drivers/thermal/intel/intel_powerclamp.c static int duration_set(const char *arg, const struct kernel_param *kp) · line 100
Quoted 8 lines
drivers/thermal/intel/intel_powerclamp.c +1
-1@@ -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!