[coreboot-gerrit] Patch set updated for coreboot: c5dd272 timer: remove rela_time type

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Tue Mar 24 12:51:33 CET 2015


Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8896

-gerrit

commit c5dd272845b533a7ab95db3ad8b746c9ae53d9e1
Author: Aaron Durbin <adurbin at chromium.org>
Date:   Wed Sep 24 09:56:18 2014 -0500

    timer: remove rela_time type
    
    Current usage doesn't require rela_time. Remove it.
    
    BUG=None
    BRANCH=None
    TEST=Built and booted.
    
    Change-Id: I25dcc1912f5db903a0523428ed1c0307db088eaa
    Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
    Original-Commit-Id: 26a13d4c615473407f401af4330199bbfe0dd2b1
    Original-Change-Id: I487ea81ffb586110e9a1c3c2629d4af749482177
    Original-Signed-off-by: Aaron Durbin <adurbin at chromium.org>
    Original-Reviewed-on: https://chromium-review.googlesource.com/219714
    Original-Reviewed-by: Furquan Shaikh <furquan at chromium.org>
---
 src/include/timer.h | 57 ++---------------------------------------------------
 1 file changed, 2 insertions(+), 55 deletions(-)

diff --git a/src/include/timer.h b/src/include/timer.h
index b034da2..243edb9 100644
--- a/src/include/timer.h
+++ b/src/include/timer.h
@@ -34,10 +34,6 @@ struct mono_time {
 	long microseconds;
 };
 
-struct rela_time {
-	long microseconds;
-};
-
 /* A timeout_callback structure is used for the book keeping for scheduling
  * work in the future. When a callback is called the structure can be
  * re-used for scheduling as it is not being tracked by the core timer
@@ -91,12 +87,6 @@ static inline void mono_time_add_msecs(struct mono_time *mt, long ms)
 	mono_time_add_usecs(mt, ms * USECS_PER_MSEC);
 }
 
-static inline void mono_time_add_rela_time(struct mono_time *mt,
-                                           const struct rela_time *t)
-{
-	mono_time_add_usecs(mt, t->microseconds);
-}
-
 /* Compare two absolute times: Return -1, 0, or 1 if t1 is <, =, or > t2,
  * respectively. */
 static inline int mono_time_cmp(const struct mono_time *t1,
@@ -111,33 +101,6 @@ static inline int mono_time_cmp(const struct mono_time *t1,
 	return 1;
 }
 
-static inline int rela_time_cmp(const struct rela_time *t1,
-                                const struct rela_time *t2)
-{
-	if (t1->microseconds == t2->microseconds)
-		return 0;
-
-	if (t1->microseconds < t2->microseconds)
-		return -1;
-
-	return 1;
-}
-
-/* Initialize a rela_time structure. */
-static inline struct rela_time rela_time_init_usecs(long us)
-{
-	struct rela_time t;
-	t.microseconds = us;
-	return t;
-}
-
-/* Return time difference between t1 and t2. i.e. t2 - t1. */
-static struct rela_time mono_time_diff(const struct mono_time *t1,
-                                       const struct mono_time *t2)
-{
-	return rela_time_init_usecs(t2->microseconds - t1->microseconds);
-}
-
 /* Return true if t1 after t2  */
 static inline int mono_time_after(const struct mono_time *t1,
                                   const struct mono_time *t2)
@@ -152,27 +115,11 @@ static inline int mono_time_before(const struct mono_time *t1,
 	return mono_time_cmp(t1, t2) < 0;
 }
 
-/* Return the difference between now and t. */
-static inline struct rela_time current_time_from(const struct mono_time *t)
-{
-	struct mono_time now;
-
-	timer_monotonic_get(&now);
-	return mono_time_diff(t, &now);
-
-}
-
-static inline long rela_time_in_microseconds(const struct rela_time *rt)
-{
-	return rt->microseconds;
-}
-
+/* Return time difference between t1 and t2. i.e. t2 - t1. */
 static inline long mono_time_diff_microseconds(const struct mono_time *t1,
 					       const struct mono_time *t2)
 {
-	struct rela_time rt;
-	rt = mono_time_diff(t1, t2);
-	return rela_time_in_microseconds(&rt);
+	return t2->microseconds - t1->microseconds;
 }
 
 struct stopwatch {



More information about the coreboot-gerrit mailing list