提交 4f5e5f2b 编写于 作者: B Borislav Petkov

x86/microcode/intel: Rename update_match_revision()

... to revision_is_newer() and push it up into the header and make it an
inline function.
Signed-off-by: NBorislav Petkov <bp@suse.de>
上级 c868570e
...@@ -60,8 +60,12 @@ extern int ...@@ -60,8 +60,12 @@ extern int
get_matching_microcode(unsigned int csig, int cpf, void *mc, int rev); get_matching_microcode(unsigned int csig, int cpf, void *mc, int rev);
extern int microcode_sanity_check(void *mc, int print_err); extern int microcode_sanity_check(void *mc, int print_err);
extern int get_matching_sig(unsigned int csig, int cpf, void *mc, int rev); extern int get_matching_sig(unsigned int csig, int cpf, void *mc, int rev);
extern int
update_match_revision(struct microcode_header_intel *mc_header, int rev); 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 #ifdef CONFIG_MICROCODE_INTEL_EARLY
extern void __init load_ucode_intel_bsp(void); extern void __init load_ucode_intel_bsp(void);
......
...@@ -285,7 +285,7 @@ static unsigned int _save_mc(struct microcode_intel **mc_saved, ...@@ -285,7 +285,7 @@ static unsigned int _save_mc(struct microcode_intel **mc_saved,
found = 1; found = 1;
if (!update_match_revision(mc_hdr, new_rev)) if (!revision_is_newer(mc_hdr, new_rev))
continue; continue;
/* /*
......
...@@ -38,12 +38,6 @@ update_match_cpu(unsigned int csig, unsigned int cpf, ...@@ -38,12 +38,6 @@ update_match_cpu(unsigned int csig, unsigned int cpf,
return (!sigmatch(sig, csig, pf, cpf)) ? 0 : 1; return (!sigmatch(sig, csig, pf, cpf)) ? 0 : 1;
} }
int
update_match_revision(struct microcode_header_intel *mc_header, int rev)
{
return (mc_header->rev <= rev) ? 0 : 1;
}
int microcode_sanity_check(void *mc, int print_err) int microcode_sanity_check(void *mc, int print_err)
{ {
unsigned long total_size, data_size, ext_table_size; unsigned long total_size, data_size, ext_table_size;
...@@ -166,7 +160,7 @@ int get_matching_microcode(unsigned int csig, int cpf, void *mc, int rev) ...@@ -166,7 +160,7 @@ int get_matching_microcode(unsigned int csig, int cpf, void *mc, int rev)
{ {
struct microcode_header_intel *mc_header = mc; struct microcode_header_intel *mc_header = mc;
if (!update_match_revision(mc_header, rev)) if (!revision_is_newer(mc_header, rev))
return 0; return 0;
return get_matching_sig(csig, cpf, mc, rev); return get_matching_sig(csig, cpf, mc, rev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册