Jianjun Wang has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/63190 )
Change subject: soc/mediatek: Fix function type and initialize structure to zero ......................................................................
soc/mediatek: Fix function type and initialize structure to zero
Fix function type to comply with the data type of return value, and initialize structure to zero to replace memset.
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 --- M src/soc/mediatek/common/early_init.c M src/soc/mediatek/common/include/soc/early_init.h 2 files changed, 3 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/63190/1
diff --git a/src/soc/mediatek/common/early_init.c b/src/soc/mediatek/common/early_init.c index 329663c..55ba447 100644 --- a/src/soc/mediatek/common/early_init.c +++ b/src/soc/mediatek/common/early_init.c @@ -31,16 +31,14 @@ 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; diff --git a/src/soc/mediatek/common/include/soc/early_init.h b/src/soc/mediatek/common/include/soc/early_init.h index 2811b0d..533dffd 100644 --- a/src/soc/mediatek/common/include/soc/early_init.h +++ b/src/soc/mediatek/common/include/soc/early_init.h @@ -21,6 +21,6 @@
void early_init_clear(void); void early_init_save_time(enum early_init_type 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);
#endif /* SOC_MEDIATEK_EARLY_INIT_H */