From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757048AbcBIMYm (ORCPT ); Tue, 9 Feb 2016 07:24:42 -0500 Received: from terminus.zytor.com ([198.137.202.10]:36226 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755665AbcBIMYk (ORCPT ); Tue, 9 Feb 2016 07:24:40 -0500 Date: Tue, 9 Feb 2016 04:24:02 -0800 From: tip-bot for Borislav Petkov Message-ID: Cc: bp@suse.de, peterz@infradead.org, tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, tv@lio96.de, torvalds@linux-foundation.org Reply-To: bp@suse.de, mingo@kernel.org, peterz@infradead.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, hpa@zytor.com, torvalds@linux-foundation.org, tv@lio96.de In-Reply-To: <1454499225-21544-12-git-send-email-bp@alien8.de> References: <1454499225-21544-12-git-send-email-bp@alien8.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/microcode] x86/microcode/intel: Cleanup apply_microcode_intel() Git-Commit-ID: 26cbaa4dc676a444aa626cbc642c4c8181ef1378 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 Commit-ID: 26cbaa4dc676a444aa626cbc642c4c8181ef1378 Gitweb: http://git.kernel.org/tip/26cbaa4dc676a444aa626cbc642c4c8181ef1378 Author: Borislav Petkov AuthorDate: Wed, 3 Feb 2016 12:33:39 +0100 Committer: Ingo Molnar CommitDate: Tue, 9 Feb 2016 11:41:17 +0100 x86/microcode/intel: Cleanup apply_microcode_intel() Get rid of local variable cpu_num as it is equal to @cpu now. Deref cpu_data() only when it is really needed at the end. No functionality change. Tested-by: Thomas Voegtle Signed-off-by: Borislav Petkov Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1454499225-21544-12-git-send-email-bp@alien8.de Signed-off-by: Ingo Molnar --- arch/x86/kernel/cpu/microcode/intel.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c index c029c2b..35186a0 100644 --- a/arch/x86/kernel/cpu/microcode/intel.c +++ b/arch/x86/kernel/cpu/microcode/intel.c @@ -839,12 +839,11 @@ static int apply_microcode_intel(int cpu) { struct microcode_intel *mc; struct ucode_cpu_info *uci; + struct cpuinfo_x86 *c; unsigned int val[2]; - int cpu_num = raw_smp_processor_id(); - struct cpuinfo_x86 *c = &cpu_data(cpu_num); /* We should bind the task to the CPU */ - if (WARN_ON(cpu_num != cpu)) + if (WARN_ON(raw_smp_processor_id() != cpu)) return -1; uci = ucode_cpu_info + cpu; @@ -874,15 +873,18 @@ static int apply_microcode_intel(int cpu) if (val[1] != mc->hdr.rev) { pr_err("CPU%d update to revision 0x%x failed\n", - cpu_num, mc->hdr.rev); + cpu, mc->hdr.rev); return -1; } + pr_info("CPU%d updated to revision 0x%x, date = %04x-%02x-%02x\n", - cpu_num, val[1], + cpu, val[1], mc->hdr.date & 0xffff, mc->hdr.date >> 24, (mc->hdr.date >> 16) & 0xff); + c = &cpu_data(cpu); + uci->cpu_sig.rev = val[1]; c->microcode = val[1];