diff options
author | Borislav Petkov <bp@suse.de> | 2016-02-03 06:33:39 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-02-09 05:41:17 -0500 |
commit | 26cbaa4dc676a444aa626cbc642c4c8181ef1378 (patch) | |
tree | f60e5f7090931434b6d0ebebe1d4ce441e056f1e /arch/x86/kernel/cpu/microcode | |
parent | 58b5f2cc4bdbc9b616e68639f5a84886aa5be590 (diff) |
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 <tv@lio96.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
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/1454499225-21544-12-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/cpu/microcode')
-rw-r--r-- | arch/x86/kernel/cpu/microcode/intel.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c index c029c2bb2a29..35186a0dd5fc 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) | |||
839 | { | 839 | { |
840 | struct microcode_intel *mc; | 840 | struct microcode_intel *mc; |
841 | struct ucode_cpu_info *uci; | 841 | struct ucode_cpu_info *uci; |
842 | struct cpuinfo_x86 *c; | ||
842 | unsigned int val[2]; | 843 | unsigned int val[2]; |
843 | int cpu_num = raw_smp_processor_id(); | ||
844 | struct cpuinfo_x86 *c = &cpu_data(cpu_num); | ||
845 | 844 | ||
846 | /* We should bind the task to the CPU */ | 845 | /* We should bind the task to the CPU */ |
847 | if (WARN_ON(cpu_num != cpu)) | 846 | if (WARN_ON(raw_smp_processor_id() != cpu)) |
848 | return -1; | 847 | return -1; |
849 | 848 | ||
850 | uci = ucode_cpu_info + cpu; | 849 | uci = ucode_cpu_info + cpu; |
@@ -874,15 +873,18 @@ static int apply_microcode_intel(int cpu) | |||
874 | 873 | ||
875 | if (val[1] != mc->hdr.rev) { | 874 | if (val[1] != mc->hdr.rev) { |
876 | pr_err("CPU%d update to revision 0x%x failed\n", | 875 | pr_err("CPU%d update to revision 0x%x failed\n", |
877 | cpu_num, mc->hdr.rev); | 876 | cpu, mc->hdr.rev); |
878 | return -1; | 877 | return -1; |
879 | } | 878 | } |
879 | |||
880 | pr_info("CPU%d updated to revision 0x%x, date = %04x-%02x-%02x\n", | 880 | pr_info("CPU%d updated to revision 0x%x, date = %04x-%02x-%02x\n", |
881 | cpu_num, val[1], | 881 | cpu, val[1], |
882 | mc->hdr.date & 0xffff, | 882 | mc->hdr.date & 0xffff, |
883 | mc->hdr.date >> 24, | 883 | mc->hdr.date >> 24, |
884 | (mc->hdr.date >> 16) & 0xff); | 884 | (mc->hdr.date >> 16) & 0xff); |
885 | 885 | ||
886 | c = &cpu_data(cpu); | ||
887 | |||
886 | uci->cpu_sig.rev = val[1]; | 888 | uci->cpu_sig.rev = val[1]; |
887 | c->microcode = val[1]; | 889 | c->microcode = val[1]; |
888 | 890 | ||