Attention is currently required from: Jason Glenesk, Raul Rangel, Matt DeVillier, Fred Reitberger.
Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/73317 )
Change subject: soc/amd/common/block/apob/apob_cache: use enum cb_err ......................................................................
soc/amd/common/block/apob/apob_cache: use enum cb_err
Use enum cb_err to return an error/success state instead of an int in get_nv_rdev and get_nv_rdev_rw.
Signed-off-by: Felix Held felix-coreboot@felixheld.de Change-Id: I73706a93bc1dbc8556e11885faf7f486c468bea9 --- M src/soc/amd/common/block/apob/apob_cache.c 1 file changed, 23 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/73317/1
diff --git a/src/soc/amd/common/block/apob/apob_cache.c b/src/soc/amd/common/block/apob/apob_cache.c index 5eab44b..06dc597 100644 --- a/src/soc/amd/common/block/apob/apob_cache.c +++ b/src/soc/amd/common/block/apob/apob_cache.c @@ -90,26 +90,26 @@ return apob_src_ram; }
-static int get_nv_rdev(struct region_device *r) +static enum cb_err get_nv_rdev(struct region_device *r) { if (fmap_locate_area_as_rdev(vboot_recovery_mode_enabled() ? RECOVERY_MRC_CACHE : DEFAULT_MRC_CACHE, r) < 0) { printk(BIOS_ERR, "No APOB NV region is found in flash\n"); - return -1; + return CB_ERR; }
- return 0; + return CB_SUCCESS; }
-static int get_nv_rdev_rw(struct region_device *r) +static enum cb_err get_nv_rdev_rw(struct region_device *r) { if (fmap_locate_area_as_rdev_rw(vboot_recovery_mode_enabled() ? RECOVERY_MRC_CACHE : DEFAULT_MRC_CACHE, r) < 0) { printk(BIOS_ERR, "No APOB NV region is found in flash\n"); - return -1; + return CB_ERR; }
- return 0; + return CB_SUCCESS; }
static struct apob_thread_context { @@ -146,7 +146,7 @@ if (acpi_is_wakeup_s3()) return;
- if (get_nv_rdev(&thread->apob_rdev) != 0) + if (get_nv_rdev(&thread->apob_rdev) != CB_SUCCESS) return;
assert(ARRAY_SIZE(thread->buffer) == region_device_sz(&thread->apob_rdev)); @@ -210,7 +210,7 @@ if (apob_src_ram == NULL) return;
- if (get_nv_rdev(&read_rdev) != 0) + if (get_nv_rdev(&read_rdev) != CB_SUCCESS) return;
timestamp_add_now(TS_AMD_APOB_READ_START); @@ -251,7 +251,7 @@ apob_src_ram, apob_src_ram->size, region_device_offset(&read_rdev), region_device_sz(&read_rdev));
- if (get_nv_rdev_rw(&write_rdev) != 0) + if (get_nv_rdev_rw(&write_rdev) != CB_SUCCESS) return;
timestamp_add_now(TS_AMD_APOB_ERASE_START); @@ -281,7 +281,7 @@ { struct region_device rdev;
- if (get_nv_rdev(&rdev) != 0) + if (get_nv_rdev(&rdev) != CB_SUCCESS) return NULL;
return get_apob_from_nv_rdev(&rdev);