diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-02-27 08:05:10 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-19 13:44:57 -0400 |
commit | 57d3da2911787a101a384532f4519f9640bae883 (patch) | |
tree | 02c71a7fec5f79ffd5a3e5a742ccd8441ed2cfe1 /include | |
parent | 79b3feffb10417f197d2ab48dd4fa3c0c9e7d788 (diff) |
time: add ns_to_ktime()
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ktime.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/ktime.h b/include/linux/ktime.h index 2cd7fa73d1af..ce5983225be4 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h | |||
@@ -327,4 +327,10 @@ extern void ktime_get_ts(struct timespec *ts); | |||
327 | /* Get the real (wall-) time in timespec format: */ | 327 | /* Get the real (wall-) time in timespec format: */ |
328 | #define ktime_get_real_ts(ts) getnstimeofday(ts) | 328 | #define ktime_get_real_ts(ts) getnstimeofday(ts) |
329 | 329 | ||
330 | static inline ktime_t ns_to_ktime(u64 ns) | ||
331 | { | ||
332 | static const ktime_t ktime_zero = { .tv64 = 0 }; | ||
333 | return ktime_add_ns(ktime_zero, ns); | ||
334 | } | ||
335 | |||
330 | #endif | 336 | #endif |