summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorLee Leahy <leroy.p.leahy@intel.com>2016-05-17 09:29:09 -0700
committerLeroy P Leahy <leroy.p.leahy@intel.com>2016-05-17 20:16:24 +0200
commitd3989a26c17118b5a40cd3b05e701ae12151bd90 (patch)
treed17126a30f66af362288f5a7863522ed248fbd35 /src/drivers
parent00c35c1a9873eda27944d076a31397dbcb50befd (diff)
drivers/intel/fsp1_1: Simplify union references
Simplify the union references to enable Coverity to properly process the routine. Found-by: Coverify CID 1349854 TEST=Build and run on Galileo Gen2 Change-Id: I667b9bc5fcde7f68cb9b4c8fa85601998e5c81ff Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com> Reviewed-on: https://review.coreboot.org/14870 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/intel/fsp1_1/fsp_util.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/drivers/intel/fsp1_1/fsp_util.c b/src/drivers/intel/fsp1_1/fsp_util.c
index 49a494feda..6e490d32fa 100644
--- a/src/drivers/intel/fsp1_1/fsp_util.c
+++ b/src/drivers/intel/fsp1_1/fsp_util.c
@@ -29,7 +29,6 @@ FSP_INFO_HEADER *find_fsp(uintptr_t fsp_base_address)
EFI_FIRMWARE_VOLUME_EXT_HEADER *fveh;
EFI_FIRMWARE_VOLUME_HEADER *fvh;
EFI_RAW_SECTION *rs;
- u8 *u8;
u32 u32;
} fsp_ptr;
static const union {
@@ -50,9 +49,9 @@ FSP_INFO_HEADER *find_fsp(uintptr_t fsp_base_address)
}
/* Locate the file header which follows the FV header. */
- fsp_ptr.u8 += fsp_ptr.fvh->ExtHeaderOffset;
- fsp_ptr.u8 += fsp_ptr.fveh->ExtHeaderSize;
- fsp_ptr.u8 = (u8 *)ALIGN_UP(fsp_ptr.u32, 8);
+ fsp_ptr.u32 += fsp_ptr.fvh->ExtHeaderOffset;
+ fsp_ptr.u32 += fsp_ptr.fveh->ExtHeaderSize;
+ fsp_ptr.u32 = ALIGN_UP(fsp_ptr.u32, 8);
/* Check the FFS GUID */
if ((((u32 *)&fsp_ptr.ffh->Name)[0] != 0x912740BE)
@@ -63,14 +62,14 @@ FSP_INFO_HEADER *find_fsp(uintptr_t fsp_base_address)
}
/* Locate the Raw Section Header */
- fsp_ptr.u8 += sizeof(EFI_FFS_FILE_HEADER);
+ fsp_ptr.u32 += sizeof(EFI_FFS_FILE_HEADER);
if (fsp_ptr.rs->Type != EFI_SECTION_RAW) {
return (FSP_INFO_HEADER *)ERROR_NO_INFO_HEADER;
}
/* Locate the FSP INFO Header which follows the Raw Header. */
- fsp_ptr.u8 += sizeof(EFI_RAW_SECTION);
+ fsp_ptr.u32 += sizeof(EFI_RAW_SECTION);
/* Verify that the FSP base address.*/
if (fsp_ptr.fih->ImageBase != fsp_base_address) {