Skip to content

Commit 47403a4

Browse files
xinli-intelKAGA-KOKO
authored andcommitted
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) <hpa@zytor.com> Signed-off-by: Xin Li (Intel) <xin@zytor.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20240201094604.3918141-1-xin@zytor.com
1 parent e37ae64 commit 47403a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kernel/nmi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ DEFINE_IDTENTRY_RAW(exc_nmi)
502502
if (IS_ENABLED(CONFIG_NMI_CHECK_CPU))
503503
raw_atomic_long_inc(&nsp->idt_calls);
504504

505-
if (IS_ENABLED(CONFIG_SMP) && arch_cpu_is_offline(smp_processor_id())) {
505+
if (arch_cpu_is_offline(smp_processor_id())) {
506506
if (microcode_nmi_handler_enabled())
507507
microcode_offline_nmi_handler();
508508
return;

0 commit comments

Comments
 (0)