return NEW_UCODE;
}
-static bool match_cpu(const struct microcode_patch *patch)
-{
- return patch && (microcode_fits(patch) == NEW_UCODE);
-}
-
static void free_patch(struct microcode_patch *patch)
{
xfree(patch);
if ( !patch )
return -ENOENT;
- if ( !match_cpu(patch) )
+ if ( microcode_fits(patch) != NEW_UCODE )
return -EINVAL;
if ( check_final_patch_levels(sig) )
#endif
.free_patch = free_patch,
.compare_patch = compare_patch,
- .match_cpu = match_cpu,
};
return mc->rev > cpu_sig->rev ? NEW_UCODE : OLD_UCODE;
}
-static bool match_cpu(const struct microcode_patch *patch)
-{
- if ( !patch )
- return false;
-
- return microcode_update_match(patch) == NEW_UCODE;
-}
-
static void free_patch(struct microcode_patch *patch)
{
xfree(patch);
if ( !patch )
return -ENOENT;
- if ( !match_cpu(patch) )
+ if ( microcode_update_match(patch) != NEW_UCODE )
return -EINVAL;
/* write microcode via MSR 0x79 */
.apply_microcode = apply_microcode,
.free_patch = free_patch,
.compare_patch = compare_patch,
- .match_cpu = match_cpu,
};
/* Free a patch previously allocated by cpu_request_microcode(). */
void (*free_patch)(struct microcode_patch *patch);
- /*
- * Is the microcode patch applicable for the current CPU, and newer than
- * the currently running patch?
- */
- bool (*match_cpu)(const struct microcode_patch *patch);
-
/*
* Given two patches, are they both applicable to the current CPU, and is
* new a higher revision than old?