Skip to content

Commit 781c27a

Browse files
cuiziweizwxiaoxiang781216
authored andcommitted
sim/oneshot: Remove redundant variables.
Signed-off-by: cuiziwei <[email protected]>
1 parent 6020cdb commit 781c27a

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

arch/sim/src/sim/sim_oneshot.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,10 @@ static const struct oneshot_operations_s g_oneshot_ops =
113113

114114
static inline void sim_timer_current(struct timespec *ts)
115115
{
116-
uint64_t nsec;
117-
time_t sec;
118-
119-
nsec = host_gettime(false);
120-
sec = nsec / NSEC_PER_SEC;
121-
nsec -= sec * NSEC_PER_SEC;
116+
uint64_t nsec = host_gettime(false);
122117

123-
ts->tv_sec = sec;
124-
ts->tv_nsec = nsec;
118+
ts->tv_sec = nsec / NSEC_PER_SEC;
119+
ts->tv_nsec = nsec % NSEC_PER_SEC;
125120
}
126121

127122
/****************************************************************************

0 commit comments

Comments
 (0)