diff options
Diffstat (limited to 'kernel/posix-cpu-timers.c')
| -rw-r--r-- | kernel/posix-cpu-timers.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c index ae5c6c147c4b..f1525ad06cb3 100644 --- a/kernel/posix-cpu-timers.c +++ b/kernel/posix-cpu-timers.c | |||
| @@ -4,8 +4,9 @@ | |||
| 4 | 4 | ||
| 5 | #include <linux/sched.h> | 5 | #include <linux/sched.h> |
| 6 | #include <linux/posix-timers.h> | 6 | #include <linux/posix-timers.h> |
| 7 | #include <asm/uaccess.h> | ||
| 8 | #include <linux/errno.h> | 7 | #include <linux/errno.h> |
| 8 | #include <linux/math64.h> | ||
| 9 | #include <asm/uaccess.h> | ||
| 9 | 10 | ||
| 10 | static int check_clock(const clockid_t which_clock) | 11 | static int check_clock(const clockid_t which_clock) |
| 11 | { | 12 | { |
| @@ -47,12 +48,10 @@ static void sample_to_timespec(const clockid_t which_clock, | |||
| 47 | union cpu_time_count cpu, | 48 | union cpu_time_count cpu, |
| 48 | struct timespec *tp) | 49 | struct timespec *tp) |
| 49 | { | 50 | { |
| 50 | if (CPUCLOCK_WHICH(which_clock) == CPUCLOCK_SCHED) { | 51 | if (CPUCLOCK_WHICH(which_clock) == CPUCLOCK_SCHED) |
| 51 | tp->tv_sec = div_long_long_rem(cpu.sched, | 52 | *tp = ns_to_timespec(cpu.sched); |
| 52 | NSEC_PER_SEC, &tp->tv_nsec); | 53 | else |
| 53 | } else { | ||
| 54 | cputime_to_timespec(cpu.cpu, tp); | 54 | cputime_to_timespec(cpu.cpu, tp); |
| 55 | } | ||
| 56 | } | 55 | } |
| 57 | 56 | ||
| 58 | static inline int cpu_time_before(const clockid_t which_clock, | 57 | static inline int cpu_time_before(const clockid_t which_clock, |
