cpufreq: conservative: Simplify the condition of storing 'down_threshold'
authorLiao Chang <liaochang1@huawei.com>
Tue, 12 Sep 2023 06:09:42 +0000 (06:09 +0000)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 6 Oct 2023 19:55:13 +0000 (21:55 +0200)
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 <liaochang1@huawei.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq_conservative.c

index b6bd0ff3532349968fcd4fff30c9ed1c3a100e5d..56500b25d77c18342b071087eb1121bfe70c389b 100644 (file)
@@ -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;