]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
x86/microcode/intel: Get rid of revision_is_newer()
authorBorislav Petkov <bp@suse.de>
Fri, 10 Apr 2015 10:50:57 +0000 (12:50 +0200)
committerIngo Molnar <mingo@kernel.org>
Wed, 6 May 2015 09:24:44 +0000 (11:24 +0200)
It is a one-liner for checking microcode header revisions. On top of
that, it can be used wrong as it was the case in _save_mc(). Get rid of
it.

Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Quentin Casasnovas <quentin.casasnovas@oracle.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/include/asm/microcode_intel.h
arch/x86/kernel/cpu/microcode/intel_early.c
arch/x86/kernel/cpu/microcode/intel_lib.c

index 2b9209c46ca939991abed04a1c5d4ef786b0c698..a4df6d292228422e72696f5809fb822097b409a5 100644 (file)
@@ -60,12 +60,6 @@ extern int get_matching_microcode(unsigned int csig, int cpf, int rev, void *mc)
 extern int microcode_sanity_check(void *mc, int print_err);
 extern int get_matching_sig(unsigned int csig, int cpf, int rev, void *mc);
 
-static inline int
-revision_is_newer(struct microcode_header_intel *mc_header, int rev)
-{
-       return (mc_header->rev <= rev) ? 0 : 1;
-}
-
 #ifdef CONFIG_MICROCODE_INTEL_EARLY
 extern void __init load_ucode_intel_bsp(void);
 extern void load_ucode_intel_ap(void);
index 2f49ab4ac0ae137d7ab0b851cf4b9e751d58922c..a394350e6092083af61edfef0e9ecd6d66008e12 100644 (file)
@@ -262,7 +262,7 @@ static unsigned int _save_mc(struct microcode_intel **mc_saved,
 
                found = 1;
 
-               if (!revision_is_newer(mc_hdr, new_rev))
+               if (mc_hdr->rev <= mc_saved_hdr->rev)
                        continue;
 
                /*
index cd47a510a3f174233300d8763705b6f200faf9f4..63b0a2e059ee27a451b55139382937600f9ffbee 100644 (file)
@@ -154,13 +154,13 @@ int get_matching_sig(unsigned int csig, int cpf, int rev, void *mc)
 /*
  * Returns 1 if update has been found, 0 otherwise.
  */
-int get_matching_microcode(unsigned int csig, int cpf, int rev, void *mc)
+int get_matching_microcode(unsigned int csig, int cpf, int new_rev, void *mc)
 {
        struct microcode_header_intel *mc_hdr = mc;
 
-       if (!revision_is_newer(mc_hdr, rev))
+       if (mc_hdr->rev <= new_rev)
                return 0;
 
-       return get_matching_sig(csig, cpf, rev, mc);
+       return get_matching_sig(csig, cpf, new_rev, mc);
 }
 EXPORT_SYMBOL_GPL(get_matching_microcode);