aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-03-14 19:12:16 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-26 07:05:57 -0400
commitbb8c61ad784d71620e234ac02f8550f405cb9d33 (patch)
treee2b775b1a78993859958cc355d1b66cba84a4de6 /drivers/cpufreq
parentb76d4fb2d9445e29f003308607c65b882b117b26 (diff)
cpufreq: Fix and clean up show_cpuinfo_cur_freq()
commit 9b4f603e7a9f4282aec451063ffbbb8bb410dcd9 upstream. There is a missing newline in show_cpuinfo_cur_freq(), so add it, but while at it clean that function up somewhat too. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/cpufreq.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 6e6c1fb60fbc..272608f102fb 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -680,9 +680,11 @@ static ssize_t show_cpuinfo_cur_freq(struct cpufreq_policy *policy,
680 char *buf) 680 char *buf)
681{ 681{
682 unsigned int cur_freq = __cpufreq_get(policy); 682 unsigned int cur_freq = __cpufreq_get(policy);
683 if (!cur_freq) 683
684 return sprintf(buf, "<unknown>"); 684 if (cur_freq)
685 return sprintf(buf, "%u\n", cur_freq); 685 return sprintf(buf, "%u\n", cur_freq);
686
687 return sprintf(buf, "<unknown>\n");
686} 688}
687 689
688/** 690/**