From 56da0b79ad6f3a96f5c14405d8622b7ed10aa1f2 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Fri, 1 Oct 2021 20:03:02 +0200 Subject: lib/hardwaremain: change type of "complete" element in boot_state struct A signed bitfield with a length of 1 bit can only have the values 0 and -1. Assigning a 1 ends up behaving as expected, but it's not the semantically correct thing to do there. Changing the type of the element to an unsigned bitfield with a length of 1 would fix that, but since this is used as a boolean value, just change it to bool type. Signed-off-by: Felix Held Change-Id: I230804335e7a15a8a9489859b20846988ba6c5cd Reviewed-on: https://review.coreboot.org/c/coreboot/+/58076 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- src/lib/hardwaremain.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/lib/hardwaremain.c b/src/lib/hardwaremain.c index cb459038b1..fe8e53f83a 100644 --- a/src/lib/hardwaremain.c +++ b/src/lib/hardwaremain.c @@ -56,7 +56,7 @@ struct boot_state { boot_state_t (*run_state)(void *arg); void *arg; int num_samples; - int complete : 1; + bool complete; }; #define BS_INIT(state_, run_func_) \ @@ -67,7 +67,7 @@ struct boot_state { .phases = { { NULL, 0 }, { NULL, 0 } }, \ .run_state = run_func_, \ .arg = NULL, \ - .complete = 0, \ + .complete = false, \ } #define BS_INIT_ENTRY(state_, run_func_) \ [state_] = BS_INIT(state_, run_func_) @@ -367,7 +367,7 @@ static void bs_walk_state_machine(void) bs_sample_time(state); - state->complete = 1; + state->complete = true; } } -- cgit v1.2.3