mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1 1/1] x86/nmi: Remove an unnecessary IS_ENABLED(CONFIG_SMP)
@ 2024-02-01  9:46 Xin Li (Intel)
  2024-02-27 21:10 ` [tip: x86/cleanups] " tip-bot2 for Xin Li (Intel)
  0 siblings, 1 reply; 2+ messages in thread
From: Xin Li (Intel) @ 2024-02-01  9:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: tglx, mingo, bp, dave.hansen, x86, hpa

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>
---
 arch/x86/kernel/nmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c
index db1c1848a1e6..6ba713406262 100644
--- a/arch/x86/kernel/nmi.c
+++ b/arch/x86/kernel/nmi.c
@@ -503,7 +503,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;

base-commit: b2803076903a83ea927c7f34deeaddf75ee38679
-- 
2.43.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-27 21:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-01  9:46 [PATCH v1 1/1] x86/nmi: Remove an unnecessary IS_ENABLED(CONFIG_SMP) Xin Li (Intel)
2024-02-27 21:10 ` [tip: x86/cleanups] " tip-bot2 for Xin Li (Intel)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®