diff options
author | Julius Werner <jwerner@chromium.org> | 2022-03-04 17:49:56 -0800 |
---|---|---|
committer | Julius Werner <jwerner@chromium.org> | 2022-03-09 02:18:21 +0000 |
commit | 69cc557cfb6eb2cbb5b137bc206cd759c1dba5f0 (patch) | |
tree | ab51422700fa7f5257fb72cc72bf8330780f8e06 /src/commonlib/bsd/cbfs_mcache.c | |
parent | 270b0b60acba4802b8a9272d2727ee576733ad47 (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/commonlib/bsd/cbfs_mcache.c')
-rw-r--r-- | src/commonlib/bsd/cbfs_mcache.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/commonlib/bsd/cbfs_mcache.c b/src/commonlib/bsd/cbfs_mcache.c index 965f9faef6..29ba110d7c 100644 --- a/src/commonlib/bsd/cbfs_mcache.c +++ b/src/commonlib/bsd/cbfs_mcache.c @@ -40,8 +40,8 @@ struct cbfs_mcache_build_args { int count; }; -static cb_err_t build_walker(cbfs_dev_t dev, size_t offset, const union cbfs_mdata *mdata, - size_t already_read, void *arg) +static enum cb_err build_walker(cbfs_dev_t dev, size_t offset, const union cbfs_mdata *mdata, + size_t already_read, void *arg) { struct cbfs_mcache_build_args *args = arg; union mcache_entry *entry = args->mcache; @@ -62,8 +62,8 @@ static cb_err_t build_walker(cbfs_dev_t dev, size_t offset, const union cbfs_mda return CB_CBFS_NOT_FOUND; } -cb_err_t cbfs_mcache_build(cbfs_dev_t dev, void *mcache, size_t size, - struct vb2_hash *metadata_hash) +enum cb_err cbfs_mcache_build(cbfs_dev_t dev, void *mcache, size_t size, + struct vb2_hash *metadata_hash) { struct cbfs_mcache_build_args args = { .mcache = mcache, @@ -73,7 +73,7 @@ cb_err_t cbfs_mcache_build(cbfs_dev_t dev, void *mcache, size_t size, }; assert(size > sizeof(uint32_t) && IS_ALIGNED((uintptr_t)mcache, CBFS_MCACHE_ALIGNMENT)); - cb_err_t ret = cbfs_walk(dev, build_walker, &args, metadata_hash, 0); + enum cb_err ret = cbfs_walk(dev, build_walker, &args, metadata_hash, 0); union mcache_entry *entry = args.mcache; if (ret == CB_CBFS_NOT_FOUND) { ret = CB_SUCCESS; @@ -88,8 +88,8 @@ cb_err_t cbfs_mcache_build(cbfs_dev_t dev, void *mcache, size_t size, return ret; } -cb_err_t cbfs_mcache_lookup(const void *mcache, size_t mcache_size, const char *name, - union cbfs_mdata *mdata_out, size_t *data_offset_out) +enum cb_err cbfs_mcache_lookup(const void *mcache, size_t mcache_size, const char *name, + union cbfs_mdata *mdata_out, size_t *data_offset_out) { const size_t namesize = strlen(name) + 1; /* Count trailing \0 so we can memcmp() it. */ const void *end = mcache + mcache_size; |