|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen master] x86/ucode: Create a real type for loading_state
commit e6600dc1bad9b57e65dd1f0313ed8b6f0edb8cc3
Author: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Mon Nov 17 18:28:51 2025 +0000
Commit: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Mon Nov 24 15:17:39 2025 +0000
x86/ucode: Create a real type for loading_state
Using typeof() in wait_for_state()/set_state() unnecesserily cryptic, and
more
verbose than using a proper type.
No functional change.
Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
xen/arch/x86/cpu/microcode/core.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/xen/arch/x86/cpu/microcode/core.c
b/xen/arch/x86/cpu/microcode/core.c
index 7aaf62839f..fe47c3a6c1 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -70,12 +70,13 @@ static unsigned int nr_cores;
* - LOADING_ENTER: all CPUs have called in. Initiate ucode loading.
* - LOADING_EXIT: ucode loading is done or aborted.
*/
-static enum {
+typedef enum {
LOADING_PREPARE,
LOADING_CALLIN,
LOADING_ENTER,
LOADING_EXIT,
-} loading_state;
+} loading_state_t;
+static loading_state_t loading_state;
struct patch_with_flags {
unsigned int flags;
@@ -237,9 +238,9 @@ static bool cf_check wait_cpu_callout(unsigned int nr)
return atomic_read(&cpu_out) >= nr;
}
-static bool wait_for_state(typeof(loading_state) state)
+static bool wait_for_state(loading_state_t state)
{
- typeof(loading_state) cur_state;
+ loading_state_t cur_state;
while ( (cur_state = ACCESS_ONCE(loading_state)) != state )
{
@@ -251,7 +252,7 @@ static bool wait_for_state(typeof(loading_state) state)
return true;
}
-static void set_state(typeof(loading_state) state)
+static void set_state(loading_state_t state)
{
ACCESS_ONCE(loading_state) = state;
}
--
generated by git-patchbot for /home/xen/git/xen.git#master
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |