Commit 57d3da29 authored by Ingo Molnar's avatar Ingo Molnar

time: add ns_to_ktime()

Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 79b3feff
...@@ -327,4 +327,10 @@ extern void ktime_get_ts(struct timespec *ts); ...@@ -327,4 +327,10 @@ extern void ktime_get_ts(struct timespec *ts);
/* Get the real (wall-) time in timespec format: */ /* Get the real (wall-) time in timespec format: */
#define ktime_get_real_ts(ts) getnstimeofday(ts) #define ktime_get_real_ts(ts) getnstimeofday(ts)
static inline ktime_t ns_to_ktime(u64 ns)
{
static const ktime_t ktime_zero = { .tv64 = 0 };
return ktime_add_ns(ktime_zero, ns);
}
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment