cpufreq: Remove needless bios_limit check in show_bios_limit()
authorYue Hu <huyue2@yulong.com>
Tue, 16 Apr 2019 02:40:27 +0000 (10:40 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 16 Apr 2019 21:10:42 +0000 (23:10 +0200)
Initially, bios_limit attribute will be created if driver->bios_limit
is set in cpufreq_add_dev_interface(). So remove the redundant check
for latter show operation.

Signed-off-by: Yue Hu <huyue2@yulong.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq.c

index 3f235d5f67ee8c4975e8cf875fbf3ee647f7fa61..df7d112fe6218f9ea7d9ee89c84bae43bf71d11b 100644 (file)
@@ -894,11 +894,9 @@ static ssize_t show_bios_limit(struct cpufreq_policy *policy, char *buf)
 {
        unsigned int limit;
        int ret;
-       if (cpufreq_driver->bios_limit) {
-               ret = cpufreq_driver->bios_limit(policy->cpu, &limit);
-               if (!ret)
-                       return sprintf(buf, "%u\n", limit);
-       }
+       ret = cpufreq_driver->bios_limit(policy->cpu, &limit);
+       if (!ret)
+               return sprintf(buf, "%u\n", limit);
        return sprintf(buf, "%u\n", policy->cpuinfo.max_freq);
 }