time: add ns_to_ktime()
authorIngo Molnar <mingo@elte.hu>
Wed, 27 Feb 2008 13:05:10 +0000 (14:05 +0100)
committerIngo Molnar <mingo@elte.hu>
Sat, 19 Apr 2008 17:44:57 +0000 (19:44 +0200)
Signed-off-by: Ingo Molnar <mingo@elte.hu>
include/linux/ktime.h

index 2cd7fa73d1af88df51e6bb0daf2084dbf381ca0f..ce5983225be4e6430cadbff9cc5cbf448a66e647 100644 (file)
@@ -327,4 +327,10 @@ extern void ktime_get_ts(struct timespec *ts);
 /* 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