Skip to contentSkip to conversation

cpufreq: armada-37xx: use max() to calculate target_vm

PATCH Applied Akhilesh Patil 2 participants 3 messages Aug 9, 2025 – Aug 11, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover cpufreq: armada-37xx: use max() to calculate target_vm

This patch is motivated from previous patch [1]. As per discussion in [2], I have tested the patch for build and no additional include files are needed. Build works fine. This change is also reported by kernel test robot.

Akhilesh Patil (1):
cpufreq: armada-37xx: use max() to calculate target_vm

 drivers/cpufreq/armada-37xx-cpufreq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/1 cpufreq: armada-37xx: use max() to calculate target_vm

Use max() macro while calculating target_vm to simplify and improve the armada-37xx-cpufreq driver code.

---
 drivers/cpufreq/armada-37xx-cpufreq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/cpufreq/armada-37xx-cpufreq.c +2 -2
index f28a4435fba7..0efe403a5980 100644
@@ -265,7 +265,7 @@ static void __init armada37xx_cpufreq_avs_configure(struct regmap *base,
 	 */
 
 	target_vm = avs_map[l0_vdd_min] - 100;
-	target_vm = target_vm > MIN_VOLT_MV ? target_vm : MIN_VOLT_MV;
+	target_vm = max(target_vm, MIN_VOLT_MV);
 	dvfs->avs[1] = armada_37xx_avs_val_match(target_vm);
 
 	/*
@@ -273,7 +273,7 @@ static void __init armada37xx_cpufreq_avs_configure(struct regmap *base,
 	 * be larger than 1000mv
 	 */
 	target_vm = avs_map[l0_vdd_min] - 150;
-	target_vm = target_vm > MIN_VOLT_MV ? target_vm : MIN_VOLT_MV;
+	target_vm = max(target_vm, MIN_VOLT_MV);
 	dvfs->avs[2] = dvfs->avs[3] = armada_37xx_avs_val_match(target_vm);
 
 	/*
Signature · 1 line
2.34.1
maintainer Applied
#2 lore raw
Quoted 11 lines · Akhilesh Patil

Use max() macro while calculating target_vm to simplify and improve the armada-37xx-cpufreq driver code.

---
 drivers/cpufreq/armada-37xx-cpufreq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Applied. Thanks.

Signature · 1 line
viresh