x86/idle: Clean up idle selection
authorThomas Gleixner <tglx@linutronix.de>
Thu, 29 Feb 2024 14:23:38 +0000 (15:23 +0100)
committerBorislav Petkov (AMD) <bp@alien8.de>
Mon, 4 Mar 2024 16:39:24 +0000 (17:39 +0100)
Clean up the code to make it readable. No functional change.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20240229142248.392017685@linutronix.de
arch/x86/kernel/process.c

index b86ff0ffe59a0000e75a09fcf52a1267748fb8f4..792394be4e602735b2387431daee29bb106dd2c2 100644 (file)
@@ -910,11 +910,13 @@ static __cpuidle void mwait_idle(void)
 
 void select_idle_routine(const struct cpuinfo_x86 *c)
 {
-#ifdef CONFIG_SMP
-       if (boot_option_idle_override == IDLE_POLL && smp_num_siblings > 1)
-               pr_warn_once("WARNING: polling idle and HT enabled, performance may degrade\n");
-#endif
-       if (x86_idle_set() || boot_option_idle_override == IDLE_POLL)
+       if (boot_option_idle_override == IDLE_POLL) {
+               if (IS_ENABLED(CONFIG_SMP) && smp_num_siblings > 1)
+                       pr_warn_once("WARNING: polling idle and HT enabled, performance may degrade\n");
+               return;
+       }
+
+       if (x86_idle_set())
                return;
 
        if (prefer_mwait_c1_over_halt(c)) {