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>
Cc: Thorsten Blum <thorsten.blum@linux.dev>, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] x86/boot: Use bool and IS_ENABLED() in query_edd()
Date: Tue,  4 Aug 2026 13:52:26 +0200	[thread overview]
Message-ID: <20260804115227.62158-5-thorsten.blum@linux.dev> (raw)
In-Reply-To: <20260804115227.62158-4-thorsten.blum@linux.dev>

In query_edd(), use bool for do_edd and initialize it directly from
CONFIG_EDD_OFF via IS_ENABLED(). Also use bool for do_mbr and be_quiet.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 arch/x86/boot/edd.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/arch/x86/boot/edd.c b/arch/x86/boot/edd.c
index 97cad16f6bf2..9956c611574b 100644
--- a/arch/x86/boot/edd.c
+++ b/arch/x86/boot/edd.c
@@ -120,26 +120,22 @@ static int get_edd_info(u8 devno, struct edd_info *ei)
 void query_edd(void)
 {
 	char eddarg[8];
-	int do_mbr = 1;
-#ifdef CONFIG_EDD_OFF
-	int do_edd = 0;
-#else
-	int do_edd = 1;
-#endif
-	int be_quiet;
+	bool do_mbr = true;
+	bool do_edd = !IS_ENABLED(CONFIG_EDD_OFF);
+	bool be_quiet;
 	int devno;
 	struct edd_info ei, *edp;
 	u32 *mbrptr;
 
 	if (cmdline_find_option("edd", eddarg, sizeof(eddarg)) > 0) {
 		if (!strcmp(eddarg, "skipmbr") || !strcmp(eddarg, "skip")) {
-			do_edd = 1;
-			do_mbr = 0;
+			do_edd = true;
+			do_mbr = false;
 		}
 		else if (!strcmp(eddarg, "off"))
-			do_edd = 0;
+			do_edd = false;
 		else if (!strcmp(eddarg, "on"))
-			do_edd = 1;
+			do_edd = true;
 	}
 
 	be_quiet = cmdline_find_option_bool("quiet");

  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 [PATCH 1/2] x86: Use IS_ENABLED() for built-in-or-module checks Thorsten Blum
2026-08-04 11:52 ` Thorsten Blum [this message]
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-5-thorsten.blum@linux.dev \
    --to=thorsten.blum@linux.dev \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@kernel.org \
    --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