Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760424AbcDMLnY (ORCPT ); Wed, 13 Apr 2016 07:43:24 -0400 Received: from terminus.zytor.com ([198.137.202.10]:56690 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758411AbcDMLnV (ORCPT ); Wed, 13 Apr 2016 07:43:21 -0400 Date: Wed, 13 Apr 2016 04:42:10 -0700 From: tip-bot for Borislav Petkov Message-ID: Cc: luto@amacapital.net, brgerst@gmail.com, bp@alien8.de, dvlasenk@redhat.com, hpa@zytor.com, torvalds@linux-foundation.org, mingo@kernel.org, tglx@linutronix.de, bp@suse.de, peterz@infradead.org, linux-kernel@vger.kernel.org Reply-To: hpa@zytor.com, dvlasenk@redhat.com, bp@suse.de, peterz@infradead.org, tglx@linutronix.de, mingo@kernel.org, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, brgerst@gmail.com, luto@amacapital.net, bp@alien8.de In-Reply-To: <1459837795-2588-5-git-send-email-bp@alien8.de> References: <1459837795-2588-5-git-send-email-bp@alien8.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/asm] x86/tsc: Save an indentation level in recalibrate_cpu_khz() Git-Commit-ID: eff4677e9fb9b680d1d5f6ba079116548d072b7e X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1753 Lines: 54 Commit-ID: eff4677e9fb9b680d1d5f6ba079116548d072b7e Gitweb: http://git.kernel.org/tip/eff4677e9fb9b680d1d5f6ba079116548d072b7e Author: Borislav Petkov AuthorDate: Tue, 5 Apr 2016 08:29:53 +0200 Committer: Ingo Molnar CommitDate: Wed, 13 Apr 2016 11:37:43 +0200 x86/tsc: Save an indentation level in recalibrate_cpu_khz() ... by flipping the check. Signed-off-by: Borislav Petkov Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1459837795-2588-5-git-send-email-bp@alien8.de Signed-off-by: Ingo Molnar --- arch/x86/kernel/tsc.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index 5bb702c..38ba6de 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c @@ -834,15 +834,15 @@ int recalibrate_cpu_khz(void) #ifndef CONFIG_SMP unsigned long cpu_khz_old = cpu_khz; - if (boot_cpu_has(X86_FEATURE_TSC)) { - tsc_khz = x86_platform.calibrate_tsc(); - cpu_khz = tsc_khz; - cpu_data(0).loops_per_jiffy = - cpufreq_scale(cpu_data(0).loops_per_jiffy, - cpu_khz_old, cpu_khz); - return 0; - } else + if (!boot_cpu_has(X86_FEATURE_TSC)) return -ENODEV; + + tsc_khz = x86_platform.calibrate_tsc(); + cpu_khz = tsc_khz; + cpu_data(0).loops_per_jiffy = cpufreq_scale(cpu_data(0).loops_per_jiffy, + cpu_khz_old, cpu_khz); + + return 0; #else return -ENODEV; #endif