Skip to content

Commit

Permalink
x86/microcode: Get rid of struct apply_microcode_ctx
Browse files Browse the repository at this point in the history
It is a useless remnant from earlier times. Use the ucode_state enum
directly.

No functional change.

Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Tom Lendacky <thomas.lendacky@amd.com>
Tested-by: Ashok Raj <ashok.raj@intel.com>
Cc: Arjan Van De Ven <arjan.van.de.ven@intel.com>
Link: https://lkml.kernel.org/r/20180228102846.13447-2-bp@alien8.de
  • Loading branch information
Borislav Petkov authored and Thomas Gleixner committed Mar 8, 2018
1 parent 3626822 commit 854857f
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions arch/x86/kernel/cpu/microcode/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,26 +373,23 @@ static int collect_cpu_info(int cpu)
return ret;
}

struct apply_microcode_ctx {
enum ucode_state err;
};

static void apply_microcode_local(void *arg)
{
struct apply_microcode_ctx *ctx = arg;
enum ucode_state *err = arg;

ctx->err = microcode_ops->apply_microcode(smp_processor_id());
*err = microcode_ops->apply_microcode(smp_processor_id());
}

static int apply_microcode_on_target(int cpu)
{
struct apply_microcode_ctx ctx = { .err = 0 };
enum ucode_state err;
int ret;

ret = smp_call_function_single(cpu, apply_microcode_local, &ctx, 1);
if (!ret)
ret = ctx.err;

ret = smp_call_function_single(cpu, apply_microcode_local, &err, 1);
if (!ret) {
if (err == UCODE_ERROR)
ret = 1;
}
return ret;
}

Expand Down

0 comments on commit 854857f

Please sign in to comment.