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 /payloads/libpayload/tests | |
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 'payloads/libpayload/tests')
-rw-r--r-- | payloads/libpayload/tests/libcbfs/cbfs-lookup-test.c | 20 | ||||
-rw-r--r-- | payloads/libpayload/tests/libcbfs/cbfs-verification-test.c | 14 |
2 files changed, 17 insertions, 17 deletions
diff --git a/payloads/libpayload/tests/libcbfs/cbfs-lookup-test.c b/payloads/libpayload/tests/libcbfs/cbfs-lookup-test.c index 0f840763a8..0650e313e7 100644 --- a/payloads/libpayload/tests/libcbfs/cbfs-lookup-test.c +++ b/payloads/libpayload/tests/libcbfs/cbfs-lookup-test.c @@ -40,7 +40,7 @@ size_t ulz4fn(const void *src, size_t srcn, void *dst, size_t dstn) static size_t test_fmap_offset = 0; static size_t test_fmap_size = 0; -static cb_err_t test_fmap_result = CB_SUCCESS; +static enum cb_err test_fmap_result = CB_SUCCESS; static void set_fmap_locate_area_results(size_t offset, size_t size, size_t result) { @@ -49,15 +49,15 @@ static void set_fmap_locate_area_results(size_t offset, size_t size, size_t resu test_fmap_result = result; } -cb_err_t fmap_locate_area(const char *name, size_t *offset, size_t *size) +enum cb_err fmap_locate_area(const char *name, size_t *offset, size_t *size) { *offset = test_fmap_offset; *size = test_fmap_size; return test_fmap_result; } -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) { assert_non_null(mcache); assert_true(mcache_size > 0 && mcache_size % CBFS_MCACHE_ALIGNMENT == 0); @@ -66,7 +66,7 @@ cb_err_t cbfs_mcache_lookup(const void *mcache, size_t mcache_size, const char * check_expected(name); - cb_err_t ret = mock_type(cb_err_t); + enum cb_err ret = mock_type(enum cb_err); if (ret != CB_SUCCESS) return ret; @@ -75,7 +75,7 @@ cb_err_t cbfs_mcache_lookup(const void *mcache, size_t mcache_size, const char * return CB_SUCCESS; } -static void expect_cbfs_mcache_lookup(const char *name, cb_err_t err, +static void expect_cbfs_mcache_lookup(const char *name, enum cb_err err, const union cbfs_mdata *mdata, size_t data_offset_out) { expect_string(cbfs_mcache_lookup, name, name); @@ -87,13 +87,13 @@ static void expect_cbfs_mcache_lookup(const char *name, cb_err_t err, } } -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) { assert_non_null(dev); check_expected(name); - cb_err_t ret = mock_type(cb_err_t); + enum cb_err ret = mock_type(enum cb_err); if (ret != CB_SUCCESS) return ret; @@ -102,7 +102,7 @@ cb_err_t cbfs_lookup(cbfs_dev_t dev, const char *name, union cbfs_mdata *mdata_o return CB_SUCCESS; } -static void expect_cbfs_lookup(const char *name, cb_err_t err, const union cbfs_mdata *mdata, +static void expect_cbfs_lookup(const char *name, enum cb_err err, const union cbfs_mdata *mdata, size_t data_offset_out) { expect_string(cbfs_lookup, name, name); diff --git a/payloads/libpayload/tests/libcbfs/cbfs-verification-test.c b/payloads/libpayload/tests/libcbfs/cbfs-verification-test.c index 2ab3d5302d..1dcccf9ce9 100644 --- a/payloads/libpayload/tests/libcbfs/cbfs-verification-test.c +++ b/payloads/libpayload/tests/libcbfs/cbfs-verification-test.c @@ -53,19 +53,19 @@ size_t ulz4fn(const void *src, size_t srcn, void *dst, size_t dstn) return 0; } -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) { return CB_CBFS_CACHE_FULL; } -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) { assert_non_null(dev); check_expected(name); - cb_err_t ret = mock_type(cb_err_t); + enum cb_err ret = mock_type(enum cb_err); if (ret != CB_SUCCESS) return ret; @@ -74,7 +74,7 @@ cb_err_t cbfs_lookup(cbfs_dev_t dev, const char *name, union cbfs_mdata *mdata_o return CB_SUCCESS; } -static void expect_cbfs_lookup(const char *name, cb_err_t err, const union cbfs_mdata *mdata, +static void expect_cbfs_lookup(const char *name, enum cb_err err, const union cbfs_mdata *mdata, size_t data_offset_out) { expect_string(cbfs_lookup, name, name); @@ -91,7 +91,7 @@ const void *cbfs_find_attr(const union cbfs_mdata *mdata, uint32_t attr_tag, siz return mock_ptr_type(void *); } -cb_err_t fmap_locate_area(const char *name, size_t *offset, size_t *size) +enum cb_err fmap_locate_area(const char *name, size_t *offset, size_t *size) { *offset = 0; *size = 0; |