linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cpufreq: Fix and clean up show_cpuinfo_cur_freq()
@ 2017-03-14 23:12 Rafael J. Wysocki
  2017-03-15  3:00 ` Viresh Kumar
  0 siblings, 1 reply; 2+ messages in thread
From: Rafael J. Wysocki @ 2017-03-14 23:12 UTC (permalink / raw)
  To: Linux PM; +Cc: LKML, Viresh Kumar, Srinivas Pandruvada

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

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@intel.com>
---
 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");
 }
 
 /**

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] cpufreq: Fix and clean up show_cpuinfo_cur_freq()
  2017-03-14 23:12 [PATCH] cpufreq: Fix and clean up show_cpuinfo_cur_freq() Rafael J. Wysocki
@ 2017-03-15  3:00 ` Viresh Kumar
  0 siblings, 0 replies; 2+ messages in thread
From: Viresh Kumar @ 2017-03-15  3:00 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Linux PM, LKML, Srinivas Pandruvada

On 15-03-17, 00:12, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> 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@intel.com>
> ---
>  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@linaro.org>
-- 
viresh

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-15  3:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-14 23:12 [PATCH] cpufreq: Fix and clean up show_cpuinfo_cur_freq() Rafael J. Wysocki
2017-03-15  3:00 ` Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).