summaryrefslogtreecommitdiff
path: root/src/arch/x86/acpi_bert_storage.c
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2021-05-27 20:16:45 +0200
committerPatrick Georgi <pgeorgi@google.com>2021-05-30 20:16:12 +0000
commit0a88c6057a1357e8cb7ee0ab28b705336841073e (patch)
tree528d4f3d1a1b372c4e16ba0b212b0293443a25f2 /src/arch/x86/acpi_bert_storage.c
parentf156f73c624e4ec1d64e6fb5f4cad2aaefc48576 (diff)
arch/x86/acpi_bert_storage: change return type of bert_errors_present
The return value is a boolean, so use the bool type. Also add the types.h header to have the bool type defined. Also change type of bert_region_broken static variable to bool. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: I13d6472deeb26ba92d257761df069e32d9b2e5d4 Reviewed-on: https://review.coreboot.org/c/coreboot/+/55023 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/arch/x86/acpi_bert_storage.c')
-rw-r--r--src/arch/x86/acpi_bert_storage.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/arch/x86/acpi_bert_storage.c b/src/arch/x86/acpi_bert_storage.c
index b07b67ee8a..a8b8628b11 100644
--- a/src/arch/x86/acpi_bert_storage.c
+++ b/src/arch/x86/acpi_bert_storage.c
@@ -8,6 +8,7 @@
#include <acpi/acpi.h>
#include <arch/bert_storage.h>
#include <string.h>
+#include <types.h>
/* BERT region management: Allow the chipset to determine the specific
* location of the BERT region. We find that base and size, then manage
@@ -19,7 +20,7 @@
* resume cycles. If the requirements change, consider using IMD to help
* manage the space.
*/
-static int bert_region_broken;
+static bool bert_region_broken;
static void *bert_region_base;
static size_t bert_region_size;
static size_t bert_region_used;
@@ -32,9 +33,9 @@ size_t bert_storage_remaining(void)
return bert_region_broken ? 0 : bert_region_size - bert_region_used;
}
-int bert_errors_present(void)
+bool bert_errors_present(void)
{
- return bert_region_broken ? 0 : !!bert_region_used;
+ return !bert_region_broken && bert_region_used;
}
void bert_errors_region(void **start, size_t *size)
@@ -585,14 +586,14 @@ static void bert_storage_setup(int unused)
/* Always start with a blank bert region. Make sure nothing is
* maintained across reboots or resumes.
*/
- bert_region_broken = 0;
+ bert_region_broken = false;
bert_region_used = 0;
bert_reserved_region(&bert_region_base, &bert_region_size);
if (!bert_region_base || !bert_region_size) {
printk(BIOS_ERR, "Bug: Can't find/add BERT storage area\n");
- bert_region_broken = 1;
+ bert_region_broken = true;
return;
}