summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexandru Gagniuc <alexandrux.gagniuc@intel.com>2016-05-16 16:06:07 -0700
committerAaron Durbin <adurbin@chromium.org>2016-05-19 18:26:17 +0200
commit63e7b5b8a7dc69d1546ccd0d2ee4fcce8a2cc67d (patch)
tree91da1c1495d98050272e80cc265b065aaf57712e /src
parent87c6097c8f3ec812101f302ce98d0e6a53c25bab (diff)
lib/timestamp: Do not initialize cache in timestamp_cache_get()
timestamp_cache_get() would call timestamp_cache_init() whenever it found a timestamp cache in the TIMESTAMP_CACHE_UNINITIALIZED state. That means that timestamp_cache_get() will never reurn a cache in the uninitialized state. However, timestamp_init() checks against the uninitialized state, as it does not expect timestamp_cache_get() to perform any initialization. As a result, the conditional branch can never be reached. Simply remove the timestamp_cache_init() call from timestamp_cache_get(). Change-Id: I573ffbf948b69948a3b383fa3bc94382f205b8f8 Signed-off-by: Alexandru Gagniuc <alexandrux.gagniuc@intel.com> Reviewed-on: https://review.coreboot.org/14861 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/lib/timestamp.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/lib/timestamp.c b/src/lib/timestamp.c
index ae84c4f673..372076c42d 100644
--- a/src/lib/timestamp.c
+++ b/src/lib/timestamp.c
@@ -86,9 +86,6 @@ static struct timestamp_cache *timestamp_cache_get(void)
ts_cache = car_get_var_ptr((void *)_timestamp);
}
- if (ts_cache && ts_cache->cache_state == TIMESTAMP_CACHE_UNINITIALIZED)
- timestamp_cache_init(ts_cache, 0);
-
return ts_cache;
}