Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

time: add ns_to_ktime()

Signed-off-by: Ingo Molnar <mingo@elte.hu>

+6
+6
include/linux/ktime.h
··· 327 327 /* Get the real (wall-) time in timespec format: */ 328 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 336 #endif