]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
x86/cpuid: Clean up <asm/cpuid/types.h>
authorIngo Molnar <mingo@kernel.org>
Mon, 17 Mar 2025 22:18:21 +0000 (23:18 +0100)
committerIngo Molnar <mingo@kernel.org>
Wed, 19 Mar 2025 10:19:23 +0000 (11:19 +0100)
 - We have 0x0d, 0x9 and 0x1d as literals for the CPUID_LEAF definitions,
   pick a single, consistent style of 0xZZ literals.

 - Likewise, harmonize the style of the 'struct cpuid_regs' list of
   registers with that of 'enum cpuid_regs_idx'. Because while computers
   don't care about unnecessary visual noise, humans do.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: John Ogness <john.ogness@linutronix.de>
Cc: "Ahmed S. Darwish" <darwi@linutronix.de>
Cc: x86-cpuid@lists.linux.dev
Link: https://lore.kernel.org/r/20250317221824.3738853-3-mingo@kernel.org
arch/x86/include/asm/cpuid/types.h

index 724002aaff4dda1a3a95edbdd3667d47cac4a011..8582e27e836d518de9efaaf1b962b666ab7fb61a 100644 (file)
@@ -5,11 +5,14 @@
 #include <linux/types.h>
 
 /*
- * Types for raw CPUID access
+ * Types for raw CPUID access:
  */
 
 struct cpuid_regs {
-       u32 eax, ebx, ecx, edx;
+       u32 eax;
+       u32 ebx;
+       u32 ecx;
+       u32 edx;
 };
 
 enum cpuid_regs_idx {
@@ -19,8 +22,8 @@ enum cpuid_regs_idx {
        CPUID_EDX,
 };
 
-#define CPUID_LEAF_MWAIT       0x5
-#define CPUID_LEAF_DCA         0x9
+#define CPUID_LEAF_MWAIT       0x05
+#define CPUID_LEAF_DCA         0x09
 #define CPUID_LEAF_XSTATE      0x0d
 #define CPUID_LEAF_TSC         0x15
 #define CPUID_LEAF_FREQ                0x16