aboutsummaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorPatrick Rudolph <patrick.rudolph@9elements.com>2022-03-22 12:17:48 +0100
committerFelix Held <felix-coreboot@felixheld.de>2022-03-31 14:21:27 +0000
commitac49aaf0f948fec9c57c6e19ad706dedf0856960 (patch)
treeef0748706880b86602cd5397d0cd3b1d95503365 /src/drivers
parentd7803c89b6f6709a5c9e235e2961845edefed50e (diff)
drivers/intel/fsp1_1: Fix code not working with strict-aliasing rules
Change-Id: Ifc95a093cf86c834d63825bf76312ed21ec68215 Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/62995 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Frans Hendriks <fhendriks@eltan.com> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/intel/fsp1_1/hob.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/src/drivers/intel/fsp1_1/hob.c b/src/drivers/intel/fsp1_1/hob.c
index 9a09cfd81a..076dd5f768 100644
--- a/src/drivers/intel/fsp1_1/hob.c
+++ b/src/drivers/intel/fsp1_1/hob.c
@@ -257,21 +257,19 @@ static const char *get_hob_type_string(void *hob_ptr)
*/
void print_hob_type_structure(u16 hob_type, void *hob_list_ptr)
{
- u32 *current_hob;
- u32 *next_hob = 0;
- u8 last_hob = 0;
+ void *current_hob;
u32 current_type;
const char *current_type_str;
- current_hob = hob_list_ptr;
-
/*
* Print out HOBs of our desired type until
* the end of the HOB list
*/
printk(BIOS_DEBUG, "\n=== FSP HOB Data Structure ===\n");
printk(BIOS_DEBUG, "%p: hob_list_ptr\n", hob_list_ptr);
- do {
+ for (current_hob = hob_list_ptr; !END_OF_HOB_LIST(current_hob);
+ current_hob = GET_NEXT_HOB(current_hob)) {
+
EFI_HOB_GENERIC_HEADER *current_header_ptr =
(EFI_HOB_GENERIC_HEADER *)current_hob;
@@ -292,16 +290,6 @@ void print_hob_type_structure(u16 hob_type, void *hob_list_ptr)
break;
}
}
-
- /* Check for end of HOB list */
- last_hob = END_OF_HOB_LIST(current_hob);
- if (!last_hob) {
- /* Get next HOB pointer */
- next_hob = GET_NEXT_HOB(current_hob);
-
- /* Start on next HOB */
- current_hob = next_hob;
- }
- } while (!last_hob);
+ }
printk(BIOS_DEBUG, "=== End of FSP HOB Data Structure ===\n\n");
}