From: Yue Hu Date: Tue, 16 Apr 2019 02:40:27 +0000 (+0800) Subject: cpufreq: Remove needless bios_limit check in show_bios_limit() X-Git-Tag: v5.15~6480^2~3^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b23aa311fa1f376640069e5da897b4a6148d104f;p=platform%2Fkernel%2Flinux-starfive.git cpufreq: Remove needless bios_limit check in show_bios_limit() 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 Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 3f235d5f67ee..df7d112fe621 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -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); }