sim/oneshot: Remove redundant variables.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
This commit is contained in:
parent
6020cdb816
commit
781c27a98e
1 changed files with 3 additions and 8 deletions
|
@ -113,15 +113,10 @@ static const struct oneshot_operations_s g_oneshot_ops =
|
||||||
|
|
||||||
static inline void sim_timer_current(struct timespec *ts)
|
static inline void sim_timer_current(struct timespec *ts)
|
||||||
{
|
{
|
||||||
uint64_t nsec;
|
uint64_t nsec = host_gettime(false);
|
||||||
time_t sec;
|
|
||||||
|
|
||||||
nsec = host_gettime(false);
|
ts->tv_sec = nsec / NSEC_PER_SEC;
|
||||||
sec = nsec / NSEC_PER_SEC;
|
ts->tv_nsec = nsec % NSEC_PER_SEC;
|
||||||
nsec -= sec * NSEC_PER_SEC;
|
|
||||||
|
|
||||||
ts->tv_sec = sec;
|
|
||||||
ts->tv_nsec = nsec;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|
Loading…
Reference in a new issue