summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Held <felix.held@amd.corp-partner.google.com>2021-10-01 20:03:02 +0200
committerFelix Held <felix-coreboot@felixheld.de>2021-10-04 15:58:32 +0000
commit56da0b79ad6f3a96f5c14405d8622b7ed10aa1f2 (patch)
tree6cbdeab5d6a5d3b432afdc0aea26dcc85aaf13e0
parentf10776781d9449f1948147af4b06719461ba768d (diff)
downloadcoreboot-56da0b79ad6f3a96f5c14405d8622b7ed10aa1f2.tar.gz
coreboot-56da0b79ad6f3a96f5c14405d8622b7ed10aa1f2.tar.bz2
coreboot-56da0b79ad6f3a96f5c14405d8622b7ed10aa1f2.zip
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 <felix-coreboot@felixheld.de> Change-Id: I230804335e7a15a8a9489859b20846988ba6c5cd Reviewed-on: https://review.coreboot.org/c/coreboot/+/58076 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
-rw-r--r--src/lib/hardwaremain.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/hardwaremain.c b/src/lib/hardwaremain.c
index cb459038b10f..fe8e53f83a84 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;
}
}