[tip: x86/boot] x86/boot: Use bool and IS_ENABLED() to simplify query_edd()
"tip-bot2 for Thorsten Blum" <[email protected]>
| Newsgroups | gmane.linux.kernel |
|---|---|
| Message-ID | <178586628746.1210945.1116192059718626747.tip-bot2@tip-bot2> |
The following commit has been merged into the x86/boot branch of tip: Commit-ID: 2082fec6d4c65b4031dc82daa10cc9a5d35654c9 Gitweb: https://git.kernel.org/tip/2082fec6d4c65b4031dc82daa10cc9a5d35654c9 Author: Thorsten Blum <[email protected]> AuthorDate: Tue, 04 Aug 2026 13:52:26 +02:00 Committer: Ingo Molnar <[email protected]> CommitterDate: Tue, 04 Aug 2026 19:45:55 +02:00 x86/boot: Use bool and IS_ENABLED() to simplify query_edd() 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. No change in functionality intended. Signed-off-by: Thorsten Blum <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://patch.msgid.link/[email protected] --- 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 97cad16..9956c61 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");