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>
This commit is contained in:
Angel Pons 2021-06-28 15:12:40 +02:00 committed by Werner Zeh
parent a8dac049b1
commit 808692b4f4
1 changed files with 2 additions and 2 deletions

View File

@ -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 */