Skip to contentSkip to conversation

thermal: intel: Use clamp() in pkg_temp_thermal_device_add()

PATCH Applied Thorsten Blum 2 participants 2 messages Nov 16 – Nov 20 Thermal

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thermal: intel: Use clamp() in pkg_temp_thermal_device_add()

Use the simpler clamp() macro since the values are compatible.

---
 drivers/thermal/intel/x86_pkg_temp_thermal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/intel/x86_pkg_temp_thermal.c +1 -1
index 43fd5bdf1d8d..2b6265b80fe1 100644
@@ -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)
maintainer Applied
#1 lore raw
Quoted 13 lines · Thorsten Blum

Use the simpler clamp() macro since the values are compatible.

---
 drivers/thermal/intel/x86_pkg_temp_thermal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/intel/x86_pkg_temp_thermal.c +0 -0
index 43fd5bdf1d8d..2b6265b80fe1 100644

drivers/thermal/intel/x86_pkg_temp_thermal.c static int pkg_temp_thermal_device_add(unsigned int cpu) · line 333

Quoted 8 lines
drivers/thermal/intel/x86_pkg_temp_thermal.c +1 -1
@@ -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!