aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/delayacct.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2014-07-16 17:04:37 -0400
committerJohn Stultz <john.stultz@linaro.org>2014-07-23 13:18:06 -0400
commit68f6783d28316affcd2ce332d949e40e4c7416bd (patch)
treeb6e9e2b8aeaca7acbc425ae286a599d21882eeb2 /kernel/delayacct.c
parent9667a23db0dc0bd4892f0ada7e4e71528eaeed62 (diff)
delayacct: Remove braindamaged type conversions
Converting cputime to timespec and timespec to nanoseconds makes no sense. Use cputime_to_ns() and be done with it. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'kernel/delayacct.c')
-rw-r--r--kernel/delayacct.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/kernel/delayacct.c b/kernel/delayacct.c
index cf2e65dddb19..ef90b04d783f 100644
--- a/kernel/delayacct.c
+++ b/kernel/delayacct.c
@@ -82,23 +82,19 @@ void __delayacct_blkio_end(void)
82 82
83int __delayacct_add_tsk(struct taskstats *d, struct task_struct *tsk) 83int __delayacct_add_tsk(struct taskstats *d, struct task_struct *tsk)
84{ 84{
85 s64 tmp;
86 unsigned long t1;
87 unsigned long long t2, t3;
88 unsigned long flags;
89 struct timespec ts;
90 cputime_t utime, stime, stimescaled, utimescaled; 85 cputime_t utime, stime, stimescaled, utimescaled;
86 unsigned long long t2, t3;
87 unsigned long flags, t1;
88 s64 tmp;
91 89
92 tmp = (s64)d->cpu_run_real_total;
93 task_cputime(tsk, &utime, &stime); 90 task_cputime(tsk, &utime, &stime);
94 cputime_to_timespec(utime + stime, &ts); 91 tmp = (s64)d->cpu_run_real_total;
95 tmp += timespec_to_ns(&ts); 92 tmp += cputime_to_nsecs(utime + stime);
96 d->cpu_run_real_total = (tmp < (s64)d->cpu_run_real_total) ? 0 : tmp; 93 d->cpu_run_real_total = (tmp < (s64)d->cpu_run_real_total) ? 0 : tmp;
97 94
98 tmp = (s64)d->cpu_scaled_run_real_total;
99 task_cputime_scaled(tsk, &utimescaled, &stimescaled); 95 task_cputime_scaled(tsk, &utimescaled, &stimescaled);
100 cputime_to_timespec(utimescaled + stimescaled, &ts); 96 tmp = (s64)d->cpu_scaled_run_real_total;
101 tmp += timespec_to_ns(&ts); 97 tmp += cputime_to_nsecs(utimescaled + stimescaled);
102 d->cpu_scaled_run_real_total = 98 d->cpu_scaled_run_real_total =
103 (tmp < (s64)d->cpu_scaled_run_real_total) ? 0 : tmp; 99 (tmp < (s64)d->cpu_scaled_run_real_total) ? 0 : tmp;
104 100