From: Liao Chang Date: Tue, 12 Sep 2023 06:09:42 +0000 (+0000) Subject: cpufreq: conservative: Simplify the condition of storing 'down_threshold' X-Git-Tag: v6.7-rc1~157^2~1^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=842c34a2668f68ebe15d0fc9dc19d33733bb428d;p=thirdparty%2Fkernel%2Flinux.git cpufreq: conservative: Simplify the condition of storing 'down_threshold' The governor currently checks if the input new down_threshold is less than 100 before storing it, but the up_threshold field of dbs_data structure is also limited to be less than 100, so this check is unnecessary and remove it. Signed-off-by: Liao Chang Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c index b6bd0ff353234..56500b25d77c1 100644 --- a/drivers/cpufreq/cpufreq_conservative.c +++ b/drivers/cpufreq/cpufreq_conservative.c @@ -187,8 +187,7 @@ static ssize_t down_threshold_store(struct gov_attr_set *attr_set, ret = sscanf(buf, "%u", &input); /* cannot be lower than 1 otherwise freq will not fall */ - if (ret != 1 || input < 1 || input > 100 || - input >= dbs_data->up_threshold) + if (ret != 1 || input < 1 || input >= dbs_data->up_threshold) return -EINVAL; cs_tuners->down_threshold = input;