Commit ddb07a56 authored by Sandrine Bailleux's avatar Sandrine Bailleux
Browse files

refactor(measured boot): revisit error handling (1/3)



 - In event_log_init():

   Throughout the function, we are incrementing a pointer by some fixed
   amounts of bytes (corresponding to the size of some data structure or
   to some constant number of bytes), there is no variable-size
   increments in the picture. Thus it seems pointless to verify that the
   pointer has indeed been incremented by this fixed amount of bytes
   afterwards.

   For this reason, remove these checks altogether. As a result, the
   start_ptr local variable is now unused so remove it as well.

Change-Id: I612e2278cd3a63d1417427e45d81e285503f5efe
Signed-off-by: default avatarSandrine Bailleux <sandrine.bailleux@arm.com>
parent 976aedc9
......@@ -169,7 +169,6 @@ static int add_event2(const uint8_t *hash, const image_data_t *image_ptr)
void event_log_init(void)
{
const char locality_signature[] = TCG_STARTUP_LOCALITY_SIGNATURE;
const uint8_t *start_ptr;
void *ptr = event_log;
/* Get pointer to platform's measured_boot_data_t structure */
......@@ -196,11 +195,6 @@ void event_log_init(void)
((id_event_struct_data_t *)ptr)->vendor_info_size = 0;
ptr = (uint8_t *)((uintptr_t)ptr +
offsetof(id_event_struct_data_t, vendor_info));
if ((uintptr_t)ptr != ((uintptr_t)event_log + ID_EVENT_SIZE)) {
panic();
}
start_ptr = (uint8_t *)ptr;
/*
* The Startup Locality event should be placed in the log before
......@@ -237,9 +231,6 @@ void event_log_init(void)
*/
((startup_locality_event_t *)ptr)->startup_locality = 0U;
ptr = (uint8_t *)((uintptr_t)ptr + sizeof(startup_locality_event_t));
if ((uintptr_t)ptr != ((uintptr_t)start_ptr + LOC_EVENT_SIZE)) {
panic();
}
log_ptr = (uint8_t *)ptr;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment