Skip to contentSkip to conversation

thermal: intel: powerclamp: Drop redundant clamp() in duration_set()

PATCH Applied Thorsten Blum 2 participants 2 messages Aug 15 – Sep 4 Thermal

lore
Share & tools
lore
#0 lore raw

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.

---
 drivers/thermal/intel/intel_powerclamp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/intel/intel_powerclamp.c +1 -1
index bd7fd98dc310..1efdaabc4bb8 100644
@@ -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:
 
maintainer Applied
#1 lore raw
Quoted 14 lines · Thorsten Blum

duration_set() rejects any new_duration outside the valid range before the assignment, making the clamp() call redundant.

---
 drivers/thermal/intel/intel_powerclamp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/intel/intel_powerclamp.c +0 -0
index bd7fd98dc310..1efdaabc4bb8 100644

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!