soc/mediatek/early_init: Fix function return type

Fix return type of early_init_get_elapsed_time_us() to comply with the
data type of return value.

Also replace memset() with struct initializer.

Signed-off-by: Jianjun Wang <jianjun.wang@mediatek.com>
Fixes: commit 41faa22 (soc/mediatek: Add early_init for passing data
       across stages)
Change-Id: I7c361828362c2dfec91358ad8a420f5360243da0
Reviewed-on: https://review.coreboot.org/c/coreboot/+/63190
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
This commit is contained in:
Jianjun Wang
2022-03-30 09:09:43 +08:00
committed by Hung-Te Lin
parent e1e30b1504
commit 79b35ca481
3 changed files with 7 additions and 9 deletions

View File

@@ -31,16 +31,14 @@ void early_init_save_time(enum early_init_type init_type)
timer_monotonic_get(&data->init_time[init_type]);
}
uint64_t early_init_get_elapsed_time_us(enum early_init_type init_type)
long early_init_get_elapsed_time_us(enum early_init_type init_type)
{
struct early_init_data *data = find_early_init();
struct mono_time cur_time;
struct mono_time cur_time = {0};
if (!data)
return 0;
memset(&cur_time, 0, sizeof(cur_time));
/* If early init data was never saved */
if (!memcmp(&data->init_time[init_type], &cur_time, sizeof(cur_time)))
return 0;