Skip to content

Commit

Permalink
x86/boot: Change some static bootflag functions to bool
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20250129154920.6773-1-ubizjak@gmail.com
  • Loading branch information
Uros Bizjak authored and Ingo Molnar committed Feb 22, 2025
1 parent efe659a commit 5bebe2e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions arch/x86/kernel/bootflag.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -30,7 +30,7 @@ static int __init parity(u8 v)
v >>= 1;
}

return x;
return !!x;
}

static void __init sbf_write(u8 v)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5bebe2e

Please sign in to comment.