commit | 57d3da2911787a101a384532f4519f9640bae883 | [log] [tgz] |
---|---|---|
author | Ingo Molnar <mingo@elte.hu> | Wed Feb 27 14:05:10 2008 +0100 |
committer | Ingo Molnar <mingo@elte.hu> | Sat Apr 19 19:44:57 2008 +0200 |
tree | 02c71a7fec5f79ffd5a3e5a742ccd8441ed2cfe1 | |
parent | 79b3feffb10417f197d2ab48dd4fa3c0c9e7d788 [diff] [blame] |
time: add ns_to_ktime() Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/include/linux/ktime.h b/include/linux/ktime.h index 2cd7fa7..ce59832 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h
@@ -327,4 +327,10 @@ /* Get the real (wall-) time in timespec format: */ #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