Elyes Haouas has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/69327 )
Change subject: emulation/qemu-i440fx/fw_cfg.c: Use 'enum cb_err' ......................................................................
emulation/qemu-i440fx/fw_cfg.c: Use 'enum cb_err'
Also sort includes.
Change-Id: I3ddab932eaff647270681171725cefd73e3939d8 Signed-off-by: Elyes Haouas ehaouas@noos.fr --- M src/mainboard/emulation/qemu-i440fx/fw_cfg.c 1 file changed, 28 insertions(+), 14 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/27/69327/1
diff --git a/src/mainboard/emulation/qemu-i440fx/fw_cfg.c b/src/mainboard/emulation/qemu-i440fx/fw_cfg.c index 5c23988..f1be734 100644 --- a/src/mainboard/emulation/qemu-i440fx/fw_cfg.c +++ b/src/mainboard/emulation/qemu-i440fx/fw_cfg.c @@ -1,13 +1,15 @@ /* SPDX-License-Identifier: GPL-2.0-only */
+#include <acpi/acpi.h> +#include <arch/io.h> +#include <commonlib/bsd/helpers.h> +#include <commonlib/endian.h> +#include <console/console.h> #include <endian.h> +#include <smbios.h> #include <stdlib.h> #include <string.h> -#include <smbios.h> -#include <console/console.h> -#include <arch/io.h> -#include <acpi/acpi.h> -#include <commonlib/endian.h> +#include <types.h>
#include "fw_cfg.h" #include "fw_cfg_if.h" @@ -61,7 +63,7 @@ fw_cfg_read(dst, dstlen); }
-static int fw_cfg_find_file(FWCfgFile *file, const char *name) +static enum cb_err fw_cfg_find_file(FWCfgFile *file, const char *name) { uint32_t count = 0;
@@ -75,11 +77,11 @@ file->size = be32_to_cpu(file->size); file->select = be16_to_cpu(file->select); printk(BIOS_INFO, "QEMU: firmware config: Found '%s'\n", name); - return 0; + return CB_SUCCESS; } } printk(BIOS_INFO, "QEMU: firmware config: Couldn't find '%s'\n", name); - return -1; + return CB_ERR; }
int fw_cfg_check_file(FWCfgFile *file, const char *name) @@ -89,26 +91,26 @@ return fw_cfg_find_file(file, name); }
-static int fw_cfg_e820_select(uint32_t *size) +static enum cb_err fw_cfg_e820_select(uint32_t *size) { FWCfgFile file;
if (!fw_cfg_present() || fw_cfg_find_file(&file, "etc/e820")) - return -1; + return CB_ERR; fw_cfg_select(file.select); *size = file.size; - return 0; + return CB_SUCCESS; }
-static int fw_cfg_e820_read(FwCfgE820Entry *entry, uint32_t *size, +static enum cb_err fw_cfg_e820_read(FwCfgE820Entry *entry, uint32_t *size, uint32_t *pos) { if (*pos + sizeof(*entry) > *size) - return -1; + return CB_ERR;
fw_cfg_read(entry, sizeof(*entry)); *pos += sizeof(*entry); - return 0; + return CB_SUCCESS; }
/* returns tolud on success or 0 on failure */