]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
x86/cpu: Remove unnecessary macro indirection related to CPU feature names
authorBrendan Jackman <jackmanb@google.com>
Mon, 3 Mar 2025 15:45:37 +0000 (15:45 +0000)
committerIngo Molnar <mingo@kernel.org>
Tue, 4 Mar 2025 10:14:53 +0000 (11:14 +0100)
These macros used to abstract over CONFIG_X86_FEATURE_NAMES, but that
was removed in:

  7583e8fbdc49 ("x86/cpu: Remove X86_FEATURE_NAMES")

Now they are just an unnecessary indirection, remove them.

Signed-off-by: Brendan Jackman <jackmanb@google.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20250303-setcpuid-taint-louder-v1-1-8d255032cb4c@google.com
arch/x86/include/asm/cpufeature.h
arch/x86/kernel/cpu/common.c

index e5fc0038c8f658844df62849ba09d968dc4e955b..e955da397e0e207be83fe4425ffaed0177c35deb 100644 (file)
@@ -37,13 +37,8 @@ enum cpuid_leafs
        NR_CPUID_WORDS,
 };
 
-#define X86_CAP_FMT_NUM "%d:%d"
-#define x86_cap_flag_num(flag) ((flag) >> 5), ((flag) & 31)
-
 extern const char * const x86_cap_flags[NCAPINTS*32];
 extern const char * const x86_power_flags[32];
-#define X86_CAP_FMT "%s"
-#define x86_cap_flag(flag) x86_cap_flags[flag]
 
 /*
  * In order to save room, we index into this array by doing
index 0f32b6ffbf04f5394e15b50188c7d32943b0b111..b5fdaa6fd4c4ff7701009a0443ff57332503bc77 100644 (file)
@@ -667,8 +667,8 @@ static void filter_cpuid_features(struct cpuinfo_x86 *c, bool warn)
                if (!warn)
                        continue;
 
-               pr_warn("CPU: CPU feature " X86_CAP_FMT " disabled, no CPUID level 0x%x\n",
-                       x86_cap_flag(df->feature), df->level);
+               pr_warn("CPU: CPU feature %s disabled, no CPUID level 0x%x\n",
+                       x86_cap_flags[df->feature], df->level);
        }
 }
 
@@ -1502,9 +1502,9 @@ static inline void parse_set_clear_cpuid(char *arg, bool set)
 
                                /* empty-string, i.e., ""-defined feature flags */
                                if (!x86_cap_flags[bit])
-                                       pr_cont(" " X86_CAP_FMT_NUM, x86_cap_flag_num(bit));
+                                       pr_cont(" %d:%d", bit >> 5, bit & 31);
                                else
-                                       pr_cont(" " X86_CAP_FMT, x86_cap_flag(bit));
+                                       pr_cont(" %s", x86_cap_flags[bit]);
 
                                if (set)
                                        setup_force_cpu_cap(bit);
@@ -1523,9 +1523,9 @@ static inline void parse_set_clear_cpuid(char *arg, bool set)
                        const char *flag;
 
                        if (bit < 32 * NCAPINTS)
-                               flag = x86_cap_flag(bit);
+                               flag = x86_cap_flags[bit];
                        else
-                               flag = x86_bug_flag(bit - (32 * NCAPINTS));
+                               flag = x86_bug_flags[bit - (32 * NCAPINTS)];
 
                        if (!flag)
                                continue;