From: tip-bot for Borislav Petkov <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
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
Subject: [tip:x86/asm] x86/tsc: Save an indentation level in recalibrate_cpu_khz()
Date: Wed, 13 Apr 2016 04:42:10 -0700 [thread overview]
Message-ID: <tip-eff4677e9fb9b680d1d5f6ba079116548d072b7e@git.kernel.org> (raw)
In-Reply-To: <1459837795-2588-5-git-send-email-bp@alien8.de>
Commit-ID: eff4677e9fb9b680d1d5f6ba079116548d072b7e
Gitweb: http://git.kernel.org/tip/eff4677e9fb9b680d1d5f6ba079116548d072b7e
Author: Borislav Petkov <bp@suse.de>
AuthorDate: Tue, 5 Apr 2016 08:29:53 +0200
Committer: Ingo Molnar <mingo@kernel.org>
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 <bp@suse.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1459837795-2588-5-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
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
next prev parent reply other threads:[~2016-04-13 11:43 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-05 6:29 [PATCH 0/6] x86: Misc cleanups Borislav Petkov
2016-04-05 6:29 ` [PATCH 1/6] x86/fpu/regset: Use boot_cpu_has() Borislav Petkov
2016-04-05 13:51 ` Brian Gerst
2016-04-05 15:11 ` Borislav Petkov
2016-04-13 11:41 ` [tip:x86/asm] x86/fpu/regset: Replace static_cpu_has() usage with boot_cpu_has() tip-bot for Borislav Petkov
2016-04-05 6:29 ` [PATCH 2/6] x86/cpu: Simplify extended APIC ID detection on AMD Borislav Petkov
2016-04-13 11:41 ` [tip:x86/asm] " tip-bot for Borislav Petkov
2016-04-05 6:29 ` [PATCH 3/6] x86/tsc: Do not check X86_FEATURE_CONSTANT_TSC in notifier call Borislav Petkov
2016-04-05 8:00 ` Peter Zijlstra
2016-04-13 11:41 ` [tip:x86/asm] " tip-bot for Borislav Petkov
2016-04-05 6:29 ` [PATCH 4/6] x86/tsc: Save an indentation level in recalibrate_cpu_khz() Borislav Petkov
2016-04-05 8:05 ` Peter Zijlstra
2016-04-13 11:42 ` tip-bot for Borislav Petkov [this message]
2016-04-05 6:29 ` [PATCH 5/6] x86/fpu: Remove check_fpu() indirection Borislav Petkov
2016-04-13 11:42 ` [tip:x86/asm] " tip-bot for Borislav Petkov
2016-04-05 6:29 ` [PATCH 6/6] x86/fpu: Get rid of x87 math exception helpers Borislav Petkov
2016-04-13 11:42 ` [tip:x86/asm] " tip-bot for Borislav Petkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-eff4677e9fb9b680d1d5f6ba079116548d072b7e@git.kernel.org \
--to=tipbot@zytor.com \
--cc=bp@alien8.de \
--cc=bp@suse.de \
--cc=brgerst@gmail.com \
--cc=dvlasenk@redhat.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox