public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] x86/bootflag: Change some static functions to bool
@ 2025-01-29 15:47 Uros Bizjak
  2025-01-29 15:47 ` [PATCH 2/2] x86/bootflag: Use __builtin_parity() when available Uros Bizjak
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Uros Bizjak @ 2025-01-29 15:47 UTC (permalink / raw)
  To: x86, linux-kernel
  Cc: Uros Bizjak, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, H. Peter Anvin

The return values of some functions are of boolean type. Change the
type of these function to bool and adjust their return values.

No functional change intended.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
---
 arch/x86/kernel/bootflag.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/bootflag.c b/arch/x86/kernel/bootflag.c
index 3fed7ae58b60..4d89a2d80d0f 100644
--- a/arch/x86/kernel/bootflag.c
+++ b/arch/x86/kernel/bootflag.c
@@ -20,7 +20,7 @@
 
 int sbf_port __initdata = -1;	/* set via acpi_boot_init() */
 
-static int __init parity(u8 v)
+static bool __init parity(u8 v)
 {
 	int x = 0;
 	int i;
@@ -30,7 +30,7 @@ static int __init parity(u8 v)
 		v >>= 1;
 	}
 
-	return x;
+	return !!x;
 }
 
 static void __init sbf_write(u8 v)
@@ -66,14 +66,14 @@ static u8 __init sbf_read(void)
 	return v;
 }
 
-static int __init sbf_value_valid(u8 v)
+static bool __init sbf_value_valid(u8 v)
 {
 	if (v & SBF_RESERVED)		/* Reserved bits */
-		return 0;
+		return false;
 	if (!parity(v))
-		return 0;
+		return false;
 
-	return 1;
+	return true;
 }
 
 static int __init sbf_init(void)
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2025-02-26 12:22 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-29 15:47 [PATCH 1/2] x86/bootflag: Change some static functions to bool Uros Bizjak
2025-01-29 15:47 ` [PATCH 2/2] x86/bootflag: Use __builtin_parity() when available Uros Bizjak
2025-01-31 15:15   ` Uros Bizjak
2025-02-22 11:56 ` [tip: x86/boot] x86/boot: Change some static bootflag functions to bool tip-bot2 for Uros Bizjak
2025-02-24  7:18 ` [PATCH 1/2] x86/bootflag: Change some static " Jiri Slaby
2025-02-24  7:24   ` Uros Bizjak
2025-02-24  7:27     ` Jiri Slaby
2025-02-24  7:39       ` Uros Bizjak
2025-02-24  7:48         ` Jiri Slaby
2025-02-24  7:56           ` Uros Bizjak
2025-02-24 18:58           ` Ingo Molnar
2025-02-26  6:31             ` Jiri Slaby
2025-02-26  7:17               ` H. Peter Anvin
2025-02-26  7:21                 ` Jiri Slaby
2025-02-26 12:21               ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox