From: Xin Li (Intel) Date: Thu, 1 Feb 2024 09:46:04 +0000 (-0800) Subject: x86/nmi: Remove an unnecessary IS_ENABLED(CONFIG_SMP) X-Git-Tag: v6.9-rc1~187^2~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=47403a4b49767f1d533e4dc5f5cf5cc957f22a5e;p=thirdparty%2Flinux.git x86/nmi: Remove an unnecessary IS_ENABLED(CONFIG_SMP) IS_ENABLED(CONFIG_SMP) is unnecessary here: smp_processor_id() should always return zero on UP, and arch_cpu_is_offline() reduces to !(cpu == 0), so this is a statically false condition on UP. Suggested-by: H. Peter Anvin (Intel) Signed-off-by: Xin Li (Intel) Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20240201094604.3918141-1-xin@zytor.com --- diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c index 17e955ab69fed..44fe569e643c3 100644 --- a/arch/x86/kernel/nmi.c +++ b/arch/x86/kernel/nmi.c @@ -502,7 +502,7 @@ DEFINE_IDTENTRY_RAW(exc_nmi) if (IS_ENABLED(CONFIG_NMI_CHECK_CPU)) raw_atomic_long_inc(&nsp->idt_calls); - if (IS_ENABLED(CONFIG_SMP) && arch_cpu_is_offline(smp_processor_id())) { + if (arch_cpu_is_offline(smp_processor_id())) { if (microcode_nmi_handler_enabled()) microcode_offline_nmi_handler(); return;