Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753226AbdFSSgH (ORCPT + 2 others); Mon, 19 Jun 2017 14:36:07 -0400 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:52228 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750950AbdFSSgF (ORCPT ); Mon, 19 Jun 2017 14:36:05 -0400 From: Willy Tarreau To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, linux@roeck-us.net Cc: "Rafael J. Wysocki" , Jiri Slaby , Willy Tarreau Subject: [PATCH 3.10 194/268] cpufreq: Fix and clean up show_cpuinfo_cur_freq() Date: Mon, 19 Jun 2017 20:31:33 +0200 Message-Id: <1497897167-14556-195-git-send-email-w@1wt.eu> X-Mailer: git-send-email 2.8.0.rc2.1.gbe9624a In-Reply-To: <1497897167-14556-1-git-send-email-w@1wt.eu> References: <1497897167-14556-1-git-send-email-w@1wt.eu> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: "Rafael J. Wysocki" 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 Acked-by: Viresh Kumar Signed-off-by: Jiri Slaby Signed-off-by: Willy Tarreau --- drivers/cpufreq/cpufreq.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 66f6cf5..d85c418 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -437,9 +437,11 @@ static ssize_t show_cpuinfo_cur_freq(struct cpufreq_policy *policy, char *buf) { unsigned int cur_freq = __cpufreq_get(policy->cpu); - if (!cur_freq) - return sprintf(buf, ""); - return sprintf(buf, "%u\n", cur_freq); + + if (cur_freq) + return sprintf(buf, "%u\n", cur_freq); + + return sprintf(buf, "\n"); } -- 2.8.0.rc2.1.gbe9624a