summaryrefslogtreecommitdiff
path: root/tests/lib/cbfs-lookup-test.c
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 /tests/lib/cbfs-lookup-test.c
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 'tests/lib/cbfs-lookup-test.c')
-rw-r--r--tests/lib/cbfs-lookup-test.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/tests/lib/cbfs-lookup-test.c b/tests/lib/cbfs-lookup-test.c
index 63a8298cf7..75628683b6 100644
--- a/tests/lib/cbfs-lookup-test.c
+++ b/tests/lib/cbfs-lookup-test.c
@@ -70,29 +70,29 @@ size_t ulz4fn(const void *src, size_t srcn, void *dst, size_t dstn)
return dstn;
}
-extern cb_err_t __real_cbfs_lookup(cbfs_dev_t dev, const char *name,
- union cbfs_mdata *mdata_out, size_t *data_offset_out,
- struct vb2_hash *metadata_hash);
+extern enum cb_err __real_cbfs_lookup(cbfs_dev_t dev, const char *name,
+ union cbfs_mdata *mdata_out, size_t *data_offset_out,
+ struct vb2_hash *metadata_hash);
-cb_err_t cbfs_lookup(cbfs_dev_t dev, const char *name, union cbfs_mdata *mdata_out,
- size_t *data_offset_out, struct vb2_hash *metadata_hash)
+enum cb_err cbfs_lookup(cbfs_dev_t dev, const char *name, union cbfs_mdata *mdata_out,
+ size_t *data_offset_out, struct vb2_hash *metadata_hash)
{
- const cb_err_t err =
+ const enum cb_err err =
__real_cbfs_lookup(dev, name, mdata_out, data_offset_out, metadata_hash);
- assert_int_equal(err, mock_type(cb_err_t));
+ assert_int_equal(err, mock_type(enum cb_err));
return err;
}
-extern cb_err_t __real_cbfs_mcache_lookup(const void *mcache, size_t mcache_size,
+extern enum cb_err __real_cbfs_mcache_lookup(const void *mcache, size_t mcache_size,
const char *name, union cbfs_mdata *mdata_out,
size_t *data_offset_out);
-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 cb_err_t err = __real_cbfs_mcache_lookup(mcache, mcache_size, name, mdata_out,
+ const enum cb_err err = __real_cbfs_mcache_lookup(mcache, mcache_size, name, mdata_out,
data_offset_out);
- assert_int_equal(err, mock_type(cb_err_t));
+ assert_int_equal(err, mock_type(enum cb_err));
return err;
}
@@ -128,7 +128,7 @@ void *cbmem_add(u32 id, u64 size)
struct cbfs_test_state_ex {
u32 file_type;
u32 file_length;
- cb_err_t lookup_result;
+ enum cb_err lookup_result;
};
struct cbfs_test_state {
@@ -198,7 +198,7 @@ static int teardown_test_cbfs(void **state)
/* Utils */
-static void expect_lookup_result(cb_err_t res)
+static void expect_lookup_result(enum cb_err res)
{
if (CONFIG(NO_CBFS_MCACHE))
will_return(cbfs_lookup, (res));