* [PATCH] cpufreq: Remove needless bios_limit check in show_bios_limit()
@ 2019-04-16 2:40 Yue Hu
2019-04-16 13:00 ` Viresh Kumar
2019-05-01 10:23 ` Rafael J. Wysocki
0 siblings, 2 replies; 3+ messages in thread
From: Yue Hu @ 2019-04-16 2:40 UTC (permalink / raw)
To: rjw, viresh.kumar, rafael.j.wysocki; +Cc: linux-pm, huyue2
From: Yue Hu <huyue2@yulong.com>
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>
---
drivers/cpufreq/cpufreq.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index d9123de..047662b 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -857,11 +857,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);
}
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] cpufreq: Remove needless bios_limit check in show_bios_limit()
2019-04-16 2:40 [PATCH] cpufreq: Remove needless bios_limit check in show_bios_limit() Yue Hu
@ 2019-04-16 13:00 ` Viresh Kumar
2019-05-01 10:23 ` Rafael J. Wysocki
1 sibling, 0 replies; 3+ messages in thread
From: Viresh Kumar @ 2019-04-16 13:00 UTC (permalink / raw)
To: Yue Hu; +Cc: rjw, rafael.j.wysocki, linux-pm, huyue2
On 16-04-19, 10:40, Yue Hu wrote:
> From: Yue Hu <huyue2@yulong.com>
>
> 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>
> ---
> drivers/cpufreq/cpufreq.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index d9123de..047662b 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -857,11 +857,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);
> }
>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
--
viresh
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] cpufreq: Remove needless bios_limit check in show_bios_limit()
2019-04-16 2:40 [PATCH] cpufreq: Remove needless bios_limit check in show_bios_limit() Yue Hu
2019-04-16 13:00 ` Viresh Kumar
@ 2019-05-01 10:23 ` Rafael J. Wysocki
1 sibling, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2019-05-01 10:23 UTC (permalink / raw)
To: Yue Hu; +Cc: viresh.kumar, rafael.j.wysocki, linux-pm, huyue2
On Tuesday, April 16, 2019 4:40:27 AM CEST Yue Hu wrote:
> From: Yue Hu <huyue2@yulong.com>
>
> 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>
> ---
> drivers/cpufreq/cpufreq.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index d9123de..047662b 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -857,11 +857,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);
> }
>
>
Applied, thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-05-01 10:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-16 2:40 [PATCH] cpufreq: Remove needless bios_limit check in show_bios_limit() Yue Hu
2019-04-16 13:00 ` Viresh Kumar
2019-05-01 10:23 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox