From: Ingo Molnar Date: Wed, 27 Feb 2008 13:05:10 +0000 (+0100) Subject: time: add ns_to_ktime() X-Git-Tag: v2.6.26-rc1~1132^2~49 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=57d3da2911787a101a384532f4519f9640bae883;p=linux-2.6-omap-h63xx.git time: add ns_to_ktime() Signed-off-by: Ingo Molnar --- diff --git a/include/linux/ktime.h b/include/linux/ktime.h index 2cd7fa73d1a..ce5983225be 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h @@ -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