summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2022-03-04 17:49:56 -0800
committerJulius Werner <jwerner@chromium.org>2022-03-09 02:18:21 +0000
commit69cc557cfb6eb2cbb5b137bc206cd759c1dba5f0 (patch)
treeab51422700fa7f5257fb72cc72bf8330780f8e06 /src/lib
parent270b0b60acba4802b8a9272d2727ee576733ad47 (diff)
commonlib/bsd: Remove cb_err_t
cb_err_t was meant to be used in place of `enum cb_err` in all situations, but the choice to use a typedef here seems to be controversial. We should not be arbitrarily using two different identifiers for the same thing across the codebase, so since there are no use cases for serializing enum cb_err at the moment (which would be the primary reason to typedef a fixed-width integer instead), remove cb_err_t again for now. Signed-off-by: Julius Werner <jwerner@chromium.org> Change-Id: Iaec36210d129db26d51f0a105d3de070c03b686b Reviewed-on: https://review.coreboot.org/c/coreboot/+/62600 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/cbfs.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c
index 0f07a32edd..c8ca14caef 100644
--- a/src/lib/cbfs.c
+++ b/src/lib/cbfs.c
@@ -34,15 +34,15 @@ static void switch_to_postram_cache(int unused)
}
ROMSTAGE_CBMEM_INIT_HOOK(switch_to_postram_cache);
-cb_err_t _cbfs_boot_lookup(const char *name, bool force_ro,
- union cbfs_mdata *mdata, struct region_device *rdev)
+enum cb_err _cbfs_boot_lookup(const char *name, bool force_ro,
+ union cbfs_mdata *mdata, struct region_device *rdev)
{
const struct cbfs_boot_device *cbd = cbfs_get_boot_device(force_ro);
if (!cbd)
return CB_ERR;
size_t data_offset;
- cb_err_t err = CB_CBFS_CACHE_FULL;
+ enum cb_err err = CB_CBFS_CACHE_FULL;
if (!CONFIG(NO_CBFS_MCACHE) && !ENV_SMM && cbd->mcache_size)
err = cbfs_mcache_lookup(cbd->mcache, cbd->mcache_size,
name, mdata, &data_offset);
@@ -520,11 +520,11 @@ void *_cbfs_cbmem_allocator(void *arg, size_t size, const union cbfs_mdata *unus
return cbmem_add((uintptr_t)arg, size);
}
-cb_err_t cbfs_prog_stage_load(struct prog *pstage)
+enum cb_err cbfs_prog_stage_load(struct prog *pstage)
{
union cbfs_mdata mdata;
struct region_device rdev;
- cb_err_t err;
+ enum cb_err err;
prog_locate_hook(pstage);
@@ -612,8 +612,8 @@ void cbfs_boot_device_find_mcache(struct cbfs_boot_device *cbd, uint32_t id)
}
}
-cb_err_t cbfs_init_boot_device(const struct cbfs_boot_device *cbd,
- struct vb2_hash *mdata_hash)
+enum cb_err cbfs_init_boot_device(const struct cbfs_boot_device *cbd,
+ struct vb2_hash *mdata_hash)
{
/* If we have an mcache, mcache_build() will also check mdata hash. */
if (!CONFIG(NO_CBFS_MCACHE) && !ENV_SMM && cbd->mcache_size > 0)
@@ -625,7 +625,7 @@ cb_err_t cbfs_init_boot_device(const struct cbfs_boot_device *cbd,
/* Verification only: use cbfs_walk() without a walker() function to just run through
the CBFS once, will return NOT_FOUND by default. */
- cb_err_t err = cbfs_walk(&cbd->rdev, NULL, NULL, mdata_hash, 0);
+ enum cb_err err = cbfs_walk(&cbd->rdev, NULL, NULL, mdata_hash, 0);
if (err == CB_CBFS_NOT_FOUND)
err = CB_SUCCESS;
return err;
@@ -660,7 +660,7 @@ const struct cbfs_boot_device *cbfs_get_boot_device(bool force_ro)
die("Cannot locate primary CBFS");
if (ENV_INITIAL_STAGE) {
- cb_err_t err = cbfs_init_boot_device(&ro, metadata_hash_get());
+ enum cb_err err = cbfs_init_boot_device(&ro, metadata_hash_get());
if (err == CB_CBFS_HASH_MISMATCH)
die("RO CBFS metadata hash verification failure");
else if (CONFIG(TOCTOU_SAFETY) && err == CB_CBFS_CACHE_FULL)