linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: x86@kernel.org, "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Linux PM Mailing List <linux-pm@vger.kernel.org>,
	Arjan van de Ven <arjan@linux.intel.com>,
	Artem Bityutskiy <dedekind1@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH v4 1/4] x86/umwait: use 'IS_ENABLED()'
Date: Mon, 10 Jul 2023 12:30:57 +0300	[thread overview]
Message-ID: <20230710093100.918337-2-dedekind1@gmail.com> (raw)
In-Reply-To: <20230710093100.918337-1-dedekind1@gmail.com>

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 --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 */
-- 
2.40.1


  reply	other threads:[~2023-07-10  9:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-10  9:30 [PATCH v4 0/4] Sapphire Rapids C0.x idle states support Artem Bityutskiy
2023-07-10  9:30 ` Artem Bityutskiy [this message]
2023-07-10  9:30 ` [PATCH v4 2/4] x86/mwait: Add support for idle via umwait Artem Bityutskiy
2023-07-10  9:30 ` [PATCH v4 3/4] intel_idle: rename 'intel_idle_hlt_irq_on()' Artem Bityutskiy
2023-07-14 15:34   ` Rafael J. Wysocki
2023-07-14 15:39     ` Arjan van de Ven
2023-07-14 18:11     ` Artem Bityutskiy
2023-07-14 21:01     ` Peter Zijlstra
2023-07-14 21:02       ` Arjan van de Ven
2023-07-14 21:12         ` Peter Zijlstra
2023-07-10  9:31 ` [PATCH v4 4/4] intel_idle: add C0.2 state for Sapphire Rapids Xeon Artem Bityutskiy
2023-07-20 18:35 ` [PATCH v4 0/4] Sapphire Rapids C0.x idle states support Rafael J. Wysocki
2023-08-28 16:43 ` Artem Bityutskiy
2023-09-13 11:37   ` Artem Bityutskiy
2023-09-13 12:34     ` Rafael J. Wysocki
2023-09-13 12:49       ` Artem Bityutskiy
2023-09-13 12:55         ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230710093100.918337-2-dedekind1@gmail.com \
    --to=dedekind1@gmail.com \
    --cc=arjan@linux.intel.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).