diff options
author | Angel Pons <th3fanbus@gmail.com> | 2021-06-28 15:12:40 +0200 |
---|---|---|
committer | Werner Zeh <werner.zeh@siemens.com> | 2021-07-01 07:26:33 +0000 |
commit | 808692b4f41cd1867d55663e66ff21ccdf223b7d (patch) | |
tree | e3cb4a26b8ca0c7ffad928385e5a27185e425834 /src/drivers/mrc_cache | |
parent | a8dac049b1cce95635c4e8c786af861f24eb2fb5 (diff) |
drivers/mrc_cache: Avoid `sizeof` on struct type
Where applicable, use the size of the associated variable.
Change-Id: Icf4f1c8fe9f54c44b041a65eb46d6ec9f9fd6367
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55902
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'src/drivers/mrc_cache')
-rw-r--r-- | src/drivers/mrc_cache/mrc_cache.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/drivers/mrc_cache/mrc_cache.c b/src/drivers/mrc_cache/mrc_cache.c index f97031dadd..841c97ea3d 100644 --- a/src/drivers/mrc_cache/mrc_cache.c +++ b/src/drivers/mrc_cache/mrc_cache.c @@ -486,7 +486,7 @@ static void update_mrc_cache_by_type(int type, struct update_region_file_entry entries[] = { [0] = { - .size = sizeof(struct mrc_metadata), + .size = sizeof(*new_md), .data = new_md, }, [1] = { @@ -696,7 +696,7 @@ int mrc_cache_stash_data(int type, uint32_t version, const void *data, .data_checksum = compute_ip_checksum(data, size), }; md.header_checksum = - compute_ip_checksum(&md, sizeof(struct mrc_metadata)); + compute_ip_checksum(&md, sizeof(md)); if (CONFIG(MRC_STASH_TO_CBMEM)) { /* Store data in cbmem for use in ramstage */ |