summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiao Yuanhong <liaoyuanhong@vivo.com>2025-09-03 20:14:52 +0800
committerChanwoo Choi <cw00.choi@samsung.com>2025-09-08 17:19:25 +0900
commit6d0982ae7880f2c4d5fbd1b5f7574ea93d1311ac (patch)
treeaac1a07c8722d1cd10d75a5e2324935a68d300fc
parentfc33bf0e097c6834646b98a7b3da0ae5b617f0f9 (diff)
PM / devfreq: mtk-cci: avoid redundant conditions
While 'if (i <= 0) ... else if (i > 0) ...' is technically equivalent to 'if (i <= 0) ... else ...', the latter is vastly easier to read because it avoids writing out a condition that is unnecessary. Let's drop such unnecessary conditions. Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Link: https://patchwork.kernel.org/project/linux-pm/patch/20250903121452.387023-1-liaoyuanhong@vivo.com/
-rw-r--r--drivers/devfreq/mtk-cci-devfreq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/devfreq/mtk-cci-devfreq.c b/drivers/devfreq/mtk-cci-devfreq.c
index 5730076846e1..4c22be728f6a 100644
--- a/drivers/devfreq/mtk-cci-devfreq.c
+++ b/drivers/devfreq/mtk-cci-devfreq.c
@@ -86,7 +86,7 @@ static int mtk_ccifreq_set_voltage(struct mtk_ccifreq_drv *drv, int new_voltage)
soc_data->sram_max_volt);
return ret;
}
- } else if (pre_voltage > new_voltage) {
+ } else {
voltage = max(new_voltage,
pre_vsram - soc_data->max_volt_shift);
ret = regulator_set_voltage(drv->proc_reg, voltage,