Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1371267

[PATCH 4/6] x86/tsc: Save an indentation level in recalibrate_cpu_khz()

From Borislav Petkov <bp@alien8.de>
Newsgroups linux.kernel
Subject [PATCH 4/6] x86/tsc: Save an indentation level in recalibrate_cpu_khz()
Date 2016-04-05 08:40 +0200
Message-ID <rksOD-7th-29@gated-at.bofh.it> (permalink)
References <rksOC-7th-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Borislav Petkov <bp@suse.de>

... by flipping the check.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.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 5bb702c77e8f..38ba6de56ede 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
-- 
2.7.3

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/6] x86: Misc cleanups Borislav Petkov <bp@alien8.de> - 2016-04-05 08:40 +0200
  [PATCH 4/6] x86/tsc: Save an indentation level in recalibrate_cpu_khz() Borislav Petkov <bp@alien8.de> - 2016-04-05 08:40 +0200
    Re: [PATCH 4/6] x86/tsc: Save an indentation level in  recalibrate_cpu_khz() Peter Zijlstra <peterz@infradead.org> - 2016-04-05 10:10 +0200
    [tip:x86/asm] x86/tsc: Save an indentation level in  recalibrate_cpu_khz() tip-bot for Borislav Petkov <tipbot@zytor.com> - 2016-04-13 13:50 +0200
  [PATCH 3/6] x86/tsc: Do not check X86_FEATURE_CONSTANT_TSC in notifier call Borislav Petkov <bp@alien8.de> - 2016-04-05 08:40 +0200
    Re: [PATCH 3/6] x86/tsc: Do not check X86_FEATURE_CONSTANT_TSC in  notifier call Peter Zijlstra <peterz@infradead.org> - 2016-04-05 10:10 +0200
    [tip:x86/asm] x86/tsc: Do not check X86_FEATURE_CONSTANT_TSC in  notifier call tip-bot for Borislav Petkov <tipbot@zytor.com> - 2016-04-13 13:50 +0200
  [PATCH 1/6] x86/fpu/regset: Use boot_cpu_has() Borislav Petkov <bp@alien8.de> - 2016-04-05 08:40 +0200
    Re: [PATCH 1/6] x86/fpu/regset: Use boot_cpu_has() Brian Gerst <brgerst@gmail.com> - 2016-04-05 16:00 +0200
      Re: [PATCH 1/6] x86/fpu/regset: Use boot_cpu_has() Borislav Petkov <bp@alien8.de> - 2016-04-05 17:20 +0200
    [tip:x86/asm] x86/fpu/regset: Replace static_cpu_has() usage with  boot_cpu_has() tip-bot for Borislav Petkov <tipbot@zytor.com> - 2016-04-13 13:50 +0200
  [PATCH 5/6] x86/fpu: Remove check_fpu() indirection Borislav Petkov <bp@alien8.de> - 2016-04-05 08:40 +0200
    [tip:x86/asm] x86/fpu: Remove check_fpu() indirection tip-bot for Borislav Petkov <tipbot@zytor.com> - 2016-04-13 13:50 +0200

csiph-web