x86/microcode/intel: Cleanup get_matching_model_microcode()

Reflow arguments, sort local variables in reverse christmas tree, kill
"out" label.

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-16-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
Borislav Petkov 2016-02-03 12:33:43 +01:00 committed by Ingo Molnar
parent 2f303c524e
commit f96fde5319
1 changed files with 11 additions and 14 deletions

View File

@ -287,19 +287,17 @@ static unsigned int _save_mc(struct microcode_intel **mc_saved,
* BSP can stay in the platform. * BSP can stay in the platform.
*/ */
static enum ucode_state __init static enum ucode_state __init
get_matching_model_microcode(unsigned long start, get_matching_model_microcode(unsigned long start, void *data, size_t size,
void *data, size_t size, struct mc_saved_data *mcs, unsigned long *mc_ptrs,
struct mc_saved_data *mcs,
unsigned long *mc_ptrs,
struct ucode_cpu_info *uci) struct ucode_cpu_info *uci)
{ {
u8 *ucode_ptr = data;
unsigned int leftover = size;
enum ucode_state state = UCODE_OK;
unsigned int mc_size;
struct microcode_header_intel *mc_header;
struct microcode_intel *mc_saved_tmp[MAX_UCODE_COUNT]; struct microcode_intel *mc_saved_tmp[MAX_UCODE_COUNT];
struct microcode_header_intel *mc_header;
unsigned int num_saved = mcs->num_saved; unsigned int num_saved = mcs->num_saved;
enum ucode_state state = UCODE_OK;
unsigned int leftover = size;
u8 *ucode_ptr = data;
unsigned int mc_size;
int i; int i;
while (leftover && num_saved < ARRAY_SIZE(mc_saved_tmp)) { while (leftover && num_saved < ARRAY_SIZE(mc_saved_tmp)) {
@ -321,8 +319,7 @@ get_matching_model_microcode(unsigned long start,
* the platform, we need to find and save microcode patches * the platform, we need to find and save microcode patches
* with the same family and model as the BSP. * with the same family and model as the BSP.
*/ */
if (matching_model_microcode(mc_header, uci->cpu_sig.sig) != if (matching_model_microcode(mc_header, uci->cpu_sig.sig) != UCODE_OK) {
UCODE_OK) {
ucode_ptr += mc_size; ucode_ptr += mc_size;
continue; continue;
} }
@ -334,19 +331,19 @@ get_matching_model_microcode(unsigned long start,
if (leftover) { if (leftover) {
state = UCODE_ERROR; state = UCODE_ERROR;
goto out; return state;
} }
if (!num_saved) { if (!num_saved) {
state = UCODE_NFOUND; state = UCODE_NFOUND;
goto out; return state;
} }
for (i = 0; i < num_saved; i++) for (i = 0; i < num_saved; i++)
mc_ptrs[i] = (unsigned long)mc_saved_tmp[i] - start; mc_ptrs[i] = (unsigned long)mc_saved_tmp[i] - start;
mcs->num_saved = num_saved; mcs->num_saved = num_saved;
out:
return state; return state;
} }