Re: [PATCH] cpufreq: Fix and clean up show_cpuinfo_cur_freq()

From: Viresh Kumar
Date: Tue Mar 14 2017 - 23:00:33 EST


On 15-03-17, 00:12, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
>
> There is a missing newline in show_cpuinfo_cur_freq(), so add it,
> but while at it clean it up somewhat too.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
> ---
> drivers/cpufreq/cpufreq.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> Index: linux-pm/drivers/cpufreq/cpufreq.c
> ===================================================================
> --- linux-pm.orig/drivers/cpufreq/cpufreq.c
> +++ linux-pm/drivers/cpufreq/cpufreq.c
> @@ -680,9 +680,11 @@ static ssize_t show_cpuinfo_cur_freq(str
> char *buf)
> {
> unsigned int cur_freq = __cpufreq_get(policy);
> - if (!cur_freq)
> - return sprintf(buf, "<unknown>");
> - return sprintf(buf, "%u\n", cur_freq);
> +
> + if (cur_freq)
> + return sprintf(buf, "%u\n", cur_freq);
> +
> + return sprintf(buf, "<unknown>\n");
> }

Acked-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>
--
viresh