x86/microcode/intel: Rename get_matching_microcode
authorBorislav Petkov <bp@suse.de>
Sun, 17 May 2015 10:54:58 +0000 (12:54 +0200)
committerIngo Molnar <mingo@kernel.org>
Mon, 18 May 2015 07:32:36 +0000 (09:32 +0200)
... to has_newer_microcode() as it does exactly that: checks
whether binary data @mc has newer microcode patch than the
applied one. Move @mc to be the first function arg too.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Quentin Casasnovas <quentin.casasnovas@oracle.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1431860101-14847-2-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/include/asm/microcode_intel.h
arch/x86/kernel/cpu/microcode/intel.c
arch/x86/kernel/cpu/microcode/intel_early.c
arch/x86/kernel/cpu/microcode/intel_lib.c

index 3564299863f044d9fa8db82ec0430440eb82f8cb..8e87e6fe98b5c14bb7584694426a97813db3c7bb 100644 (file)
@@ -56,7 +56,7 @@ struct extended_sigtable {
 
 #define exttable_size(et) ((et)->count * EXT_SIGNATURE_SIZE + EXT_HEADER_SIZE)
 
-extern int get_matching_microcode(unsigned int csig, int cpf, int rev, void *mc);
+extern int has_newer_microcode(void *mc, unsigned int csig, int cpf, int rev);
 extern int microcode_sanity_check(void *mc, int print_err);
 extern int get_matching_sig(unsigned int csig, int cpf, void *mc);
 
index e20d4e58cd894358e2845cc89587340e2706c92d..969dc17eb1b4b86775d5496bb6ebe9ba67110b4c 100644 (file)
@@ -63,7 +63,7 @@ static int get_matching_mc(struct microcode_intel *mc_intel, int cpu)
        cpf = cpu_sig.pf;
        crev = cpu_sig.rev;
 
-       return get_matching_microcode(csig, cpf, crev, mc_intel);
+       return has_newer_microcode(mc_intel, csig, cpf, crev);
 }
 
 static int apply_microcode_intel(int cpu)
@@ -165,7 +165,7 @@ static enum ucode_state generic_load_microcode(int cpu, void *data, size_t size,
 
                csig = uci->cpu_sig.sig;
                cpf = uci->cpu_sig.pf;
-               if (get_matching_microcode(csig, cpf, new_rev, mc)) {
+               if (has_newer_microcode(mc, csig, cpf, new_rev)) {
                        vfree(new_mc);
                        new_rev = mc_header.rev;
                        new_mc  = mc;
index ccd474a7a59eef36406103140141ee89130633d4..5f828268357de7cdf47e8bd22bd4c9657cb5c56a 100644 (file)
@@ -59,10 +59,10 @@ load_microcode_early(struct microcode_intel **saved,
                ucode_ptr = saved[i];
                mc_hdr    = (struct microcode_header_intel *)ucode_ptr;
 
-               ret = get_matching_microcode(uci->cpu_sig.sig,
-                                            uci->cpu_sig.pf,
-                                            new_rev,
-                                            ucode_ptr);
+               ret = has_newer_microcode(ucode_ptr,
+                                         uci->cpu_sig.sig,
+                                         uci->cpu_sig.pf,
+                                         new_rev);
                if (!ret)
                        continue;
 
index 7de2937269238e43a2998ed904267dc902be37f7..425f8e29b79501475b940af8fb8ff4ec4363b350 100644 (file)
@@ -154,7 +154,7 @@ int get_matching_sig(unsigned int csig, int cpf, void *mc)
 /*
  * Returns 1 if update has been found, 0 otherwise.
  */
-int get_matching_microcode(unsigned int csig, int cpf, int new_rev, void *mc)
+int has_newer_microcode(void *mc, unsigned int csig, int cpf, int new_rev)
 {
        struct microcode_header_intel *mc_hdr = mc;
 
@@ -163,4 +163,4 @@ int get_matching_microcode(unsigned int csig, int cpf, int new_rev, void *mc)
 
        return get_matching_sig(csig, cpf, mc);
 }
-EXPORT_SYMBOL_GPL(get_matching_microcode);
+EXPORT_SYMBOL_GPL(has_newer_microcode);