[coreboot-gerrit] New patch to review for coreboot: timestamps: remove intermediate function in sync code path
Patrick Georgi (pgeorgi@google.com)
gerrit at coreboot.org
Fri Jul 3 16:41:23 CEST 2015
Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10786
-gerrit
commit 0323e057e0583b4d000167d7f2c0473f8692a346
Author: Patrick Georgi <pgeorgi at google.com>
Date: Fri Jul 3 16:07:38 2015 +0200
timestamps: remove intermediate function in sync code path
No need to have a simple stub function call another. Just do the deed.
Change-Id: I37d6fb24468e911f041caa4944ef906dc2ecb1b7
Signed-off-by: Patrick Georgi <pgeorgi at google.com>
---
src/lib/timestamp.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/src/lib/timestamp.c b/src/lib/timestamp.c
index c845757..8e32bfd 100644
--- a/src/lib/timestamp.c
+++ b/src/lib/timestamp.c
@@ -198,7 +198,7 @@ void timestamp_early_init(uint64_t base)
timestamp_cache_init(ts_cache, base, TIMESTAMP_CBMEM_RESET_REQD);
}
-static void timestamp_do_sync(void)
+static void timestamp_do_sync_to_cbmem(int is_recovery)
{
uint32_t i;
@@ -206,6 +206,9 @@ static void timestamp_do_sync(void)
struct timestamp_table *ts_cache_table;
struct timestamp_table *ts_cbmem_table = NULL;
+ if (!timestamp_should_run())
+ return;
+
ts_cache = timestamp_cache_get();
/* No timestamp cache found */
@@ -292,18 +295,9 @@ void timestamp_init(uint64_t base)
tst->base_time = base;
}
-/* moves timestamp data from cache to cbmem region */
-static void timestamp_reinit(int is_recovery)
-{
- if (!timestamp_should_run())
- return;
-
- timestamp_do_sync();
-}
-
/* Call timestamp_reinit CBMEM init hooks. */
-ROMSTAGE_CBMEM_INIT_HOOK(timestamp_reinit)
-RAMSTAGE_CBMEM_INIT_HOOK(timestamp_reinit)
+ROMSTAGE_CBMEM_INIT_HOOK(timestamp_do_sync_to_cbmem)
+RAMSTAGE_CBMEM_INIT_HOOK(timestamp_do_sync_to_cbmem)
/* Provide default timestamp implementation using monotonic timer. */
uint64_t __attribute__((weak)) timestamp_get(void)
More information about the coreboot-gerrit
mailing list