Sridhar Siricilla has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/75620?usp=email )
Change subject: soc/intel/common: Use memcpy library function ......................................................................
soc/intel/common: Use memcpy library function
The patch uses memcpy library function instead of copying the field by field of same structure variables.
TEST=Build the code for Gimble
Signed-off-by: Sridhar Siricilla sridhar.siricilla@intel.com Change-Id: Iff6c9a663e9e3f80cf3fb2f6d6203a95c3fea20c --- M src/soc/intel/common/block/cse/cse_lite.c 1 file changed, 2 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/75620/1
diff --git a/src/soc/intel/common/block/cse/cse_lite.c b/src/soc/intel/common/block/cse/cse_lite.c index 733f68b..0db919c 100644 --- a/src/soc/intel/common/block/cse/cse_lite.c +++ b/src/soc/intel/common/block/cse/cse_lite.c @@ -934,11 +934,7 @@ return CB_ERR; }
- fw_ver->major = man_hdr.binary_version.major; - fw_ver->minor = man_hdr.binary_version.minor; - fw_ver->hotfix = man_hdr.binary_version.hotfix; - fw_ver->build = man_hdr.binary_version.build; - + memcpy(fw_ver, &man_hdr.binary_version, sizeof(struct fw_version)); return CB_SUCCESS; }
@@ -950,11 +946,7 @@
subpart_entry = (struct subpart_entry *)(ptr + SUBPART_HEADER_SZ); man_hdr = (struct subpart_entry_manifest_header *)(ptr + subpart_entry->offset_bytes); - - fw_ver->major = man_hdr->binary_version.major; - fw_ver->minor = man_hdr->binary_version.minor; - fw_ver->hotfix = man_hdr->binary_version.hotfix; - fw_ver->build = man_hdr->binary_version.build; + memcpy(fw_ver, &man_hdr->binary_version, sizeof(struct fw_version)); }
static enum cb_err cse_prep_for_component_update(const struct cse_bp_info *cse_bp_info)