Debian Codegraph @

linux-kernel-patches/04-854857f5944c59a881ff607b37ed9ed41d031a3b.patch

raw
1 From 854857f5944c59a881ff607b37ed9ed41d031a3b Mon Sep 17 00:00:00 2001
2 From: Borislav Petkov <[email protected]>
3 Date: Wed, 28 Feb 2018 11:28:40 +0100
4 Subject: x86/microcode: Get rid of struct apply_microcode_ctx
5
6 It is a useless remnant from earlier times. Use the ucode_state enum
7 directly.
8
9 No functional change.
10
11 Signed-off-by: Borislav Petkov <[email protected]>
12 Signed-off-by: Thomas Gleixner <[email protected]>
13 Tested-by: Tom Lendacky <[email protected]>
14 Tested-by: Ashok Raj <[email protected]>
15 Cc: Arjan Van De Ven <[email protected]>
16 Link: https://lkml.kernel.org/r/[email protected]
17 ---
18 arch/x86/kernel/cpu/microcode/core.c | 19 ++++++++-----------
19 1 file changed, 8 insertions(+), 11 deletions(-)
20
21 diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
22 index aa1b9a4..6337065 100644
23 --- a/arch/x86/kernel/cpu/microcode/core.c
24 +++ b/arch/x86/kernel/cpu/microcode/core.c
25 @@ -373,26 +373,23 @@ static int collect_cpu_info(int cpu)
26 return ret;
27 }
28
29 -struct apply_microcode_ctx {
30 - enum ucode_state err;
31 -};
32 -
33 static void apply_microcode_local(void *arg)
34 {
35 - struct apply_microcode_ctx *ctx = arg;
36 + enum ucode_state *err = arg;
37
38 - ctx->err = microcode_ops->apply_microcode(smp_processor_id());
39 + *err = microcode_ops->apply_microcode(smp_processor_id());
40 }
41
42 static int apply_microcode_on_target(int cpu)
43 {
44 - struct apply_microcode_ctx ctx = { .err = 0 };
45 + enum ucode_state err;
46 int ret;
47
48 - ret = smp_call_function_single(cpu, apply_microcode_local, &ctx, 1);
49 - if (!ret)
50 - ret = ctx.err;
51 -
52 + ret = smp_call_function_single(cpu, apply_microcode_local, &err, 1);
53 + if (!ret) {
54 + if (err == UCODE_ERROR)
55 + ret = 1;
56 + }
57 return ret;
58 }
59
60 --
61 cgit v1.1
62