The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Thorsten Blum <thorsten.blum@linux.dev>
To: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	Ard Biesheuvel <ardb@kernel.org>,
	"Mike Rapoport (Microsoft)" <rppt@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	"Pratyush Yadav (Google)" <pratyush@kernel.org>,
	Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>,
	Breno Leitao <leitao@debian.org>
Cc: Thorsten Blum <thorsten.blum@linux.dev>,
	Ingo Molnar <mingo@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] x86: Use IS_ENABLED() for built-in-or-module checks
Date: Tue,  4 Aug 2026 13:52:25 +0200	[thread overview]
Message-ID: <20260804115227.62158-4-thorsten.blum@linux.dev> (raw)

Replace open-coded built-in-or-module checks for CONFIG_APM, CONFIG_EDD,
and CONFIG_X86_SPEEDSTEP_SMI with IS_ENABLED().

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 arch/x86/boot/edd.c     |  2 +-
 arch/x86/boot/main.c    | 10 ++++------
 arch/x86/kernel/setup.c |  5 ++---
 3 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/arch/x86/boot/edd.c b/arch/x86/boot/edd.c
index 1fb4bc70cee9..97cad16f6bf2 100644
--- a/arch/x86/boot/edd.c
+++ b/arch/x86/boot/edd.c
@@ -15,7 +15,7 @@
 #include <linux/edd.h>
 #include "string.h"
 
-#if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
+#if IS_ENABLED(CONFIG_EDD)
 
 /*
  * Read the MBR (first sector) from a specific device.
diff --git a/arch/x86/boot/main.c b/arch/x86/boot/main.c
index 9d0fea18d3c8..4e382d95ef9a 100644
--- a/arch/x86/boot/main.c
+++ b/arch/x86/boot/main.c
@@ -164,14 +164,12 @@ void main(void)
 	query_ist();
 
 	/* Query APM information */
-#if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE)
-	query_apm_bios();
-#endif
+	if (IS_ENABLED(CONFIG_APM))
+		query_apm_bios();
 
 	/* Query EDD information */
-#if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
-	query_edd();
-#endif
+	if (IS_ENABLED(CONFIG_EDD))
+		query_edd();
 
 	/* Set the video mode */
 	set_video();
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 46882ce79c3a..fca42b178b3c 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -120,8 +120,7 @@ struct cpuinfo_x86 new_cpu_data;
 struct apm_info apm_info;
 EXPORT_SYMBOL(apm_info);
 
-#if defined(CONFIG_X86_SPEEDSTEP_SMI) || \
-	defined(CONFIG_X86_SPEEDSTEP_SMI_MODULE)
+#if IS_ENABLED(CONFIG_X86_SPEEDSTEP_SMI)
 struct ist_info ist_info;
 EXPORT_SYMBOL(ist_info);
 #else
@@ -230,7 +229,7 @@ char builtin_cmdline[COMMAND_LINE_SIZE] = CONFIG_CMDLINE;
 bool builtin_cmdline_added __ro_after_init;
 #endif
 
-#if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
+#if IS_ENABLED(CONFIG_EDD)
 struct edd edd;
 #ifdef CONFIG_EDD_MODULE
 EXPORT_SYMBOL(edd);

             reply	other threads:[~2026-08-04 11:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-04 11:52 Thorsten Blum [this message]
2026-08-04 11:52 ` [PATCH 2/2] x86/boot: Use bool and IS_ENABLED() in query_edd() Thorsten Blum
2026-08-04 17:58   ` [tip: x86/boot] x86/boot: Use bool and IS_ENABLED() to simplify query_edd() tip-bot2 for Thorsten Blum
2026-08-04 17:43 ` [PATCH 1/2] x86: Use IS_ENABLED() for built-in-or-module checks Ingo Molnar
2026-08-04 17:58 ` [tip: x86/boot] x86/boot: Use IS_ENABLED() to simplify " tip-bot2 for Thorsten Blum

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=20260804115227.62158-4-thorsten.blum@linux.dev \
    --to=thorsten.blum@linux.dev \
    --cc=akpm@linux-foundation.org \
    --cc=ardb@kernel.org \
    --cc=arnd@arndb.de \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=harshit.m.mogalapalli@oracle.com \
    --cc=hpa@zytor.com \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=pratyush@kernel.org \
    --cc=rppt@kernel.org \
    --cc=tglx@kernel.org \
    --cc=tzimmermann@suse.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