On Saturday 11 April 2015 18:46:54 Baolin Wang wrote:
This patch introduces the cputime_to_timespec64() function and jiffies_to_timespec64() function for converting the jiffies value to timespec64 value.
Signed-off-by: Baolin Wang baolin.wang@linaro.org
include/asm-generic/cputime_jiffies.h | 6 ++++++ include/linux/jiffies.h | 2 ++ kernel/time/time.c | 14 ++++++++++++++ 3 files changed, 22 insertions(+)
diff --git a/include/asm-generic/cputime_jiffies.h b/include/asm-generic/cputime_jiffies.h index fe386fc..c0c4fcb 100644 --- a/include/asm-generic/cputime_jiffies.h +++ b/include/asm-generic/cputime_jiffies.h @@ -52,6 +52,12 @@ typedef u64 __nocast cputime64_t; jiffies_to_timespec(cputime_to_jiffies(__ct),__val) /*
- Convert cputime to timespec64.
- */
+#define cputime_to_timespec64(__ct,__val) \
- jiffies_to_timespec64(cputime_to_jiffies(__ct),__val)
+/*
- Convert cputime to timeval and back.
You missed an important piece here: cputime_to_timespec64 is architecture specific, and arch/s390 as well as arch/powerpc have their own implementations, so you have to introduce all three cputime_to_timespec64 implementations before using it.
Arnd