diff mbox series

[v4,1/4] x86/umwait: use 'IS_ENABLED()'

Message ID 20230710093100.918337-2-dedekind1@gmail.com (mailing list archive)
State Changes Requested, archived
Headers show
Series Sapphire Rapids C0.x idle states support | expand

Commit Message

Artem Bityutskiy July 10, 2023, 9:30 a.m. UTC
From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>

Both kernel coding style and x86 maintainers prefer using 'IS_ENABLED()'
instead of '#ifdef' whenever possible.

Switch '__tpause()' to 'IS_ENABLED()'.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
---
 arch/x86/include/asm/mwait.h | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/arch/x86/include/asm/mwait.h b/arch/x86/include/asm/mwait.h
index 778df05f8539..03bef2bc28d4 100644
--- a/arch/x86/include/asm/mwait.h
+++ b/arch/x86/include/asm/mwait.h
@@ -130,15 +130,15 @@  static __always_inline void mwait_idle_with_hints(unsigned long eax, unsigned lo
 static inline void __tpause(u32 ecx, u32 edx, u32 eax)
 {
 	/* "tpause %ecx, %edx, %eax;" */
-	#ifdef CONFIG_AS_TPAUSE
-	asm volatile("tpause %%ecx\n"
-		     :
-		     : "c"(ecx), "d"(edx), "a"(eax));
-	#else
-	asm volatile(".byte 0x66, 0x0f, 0xae, 0xf1\t\n"
-		     :
-		     : "c"(ecx), "d"(edx), "a"(eax));
-	#endif
+	if (IS_ENABLED(CONFIG_AS_TPAUSE)) {
+		asm volatile("tpause %%ecx\n"
+			     :
+			     : "c"(ecx), "d"(edx), "a"(eax));
+	} else {
+		asm volatile(".byte 0x66, 0x0f, 0xae, 0xf1\t\n"
+			     :
+			     : "c"(ecx), "d"(edx), "a"(eax));
+	}
 }
 
 #endif /* _ASM_X86_MWAIT_H */