diff options
author | Stanislaw Gruszka <[email protected]> | 2016-11-15 03:06:52 +0100 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2016-11-15 09:51:05 +0100 |
commit | 353c50ebe329daaf2c94dc41c1c481cbba2a31fd (patch) | |
tree | d7a5a1cf35ba6ab92e0346c069853fdc42511ada /include/linux/sched.h | |
parent | 40565b5aedd6d0ca88b7dfd3859d709d2f6f8cf9 (diff) |
sched/cputime: Simplify task_cputime()
Now since fetch_task_cputime() has no other users than task_cputime(),
its code could be used directly in task_cputime().
Moreover since only 2 task_cputime() calls of 17 use a NULL argument,
we can add dummy variables to those calls and remove NULL checks from
task_cputimes().
Also remove NULL checks from task_cputimes_scaled().
Signed-off-by: Stanislaw Gruszka <[email protected]>
Signed-off-by: Frederic Weisbecker <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Heiko Carstens <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
Cc: Michael Neuling <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index f72e81395dac..fe3ce46cfd03 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -2248,10 +2248,8 @@ extern cputime_t task_gtime(struct task_struct *t); static inline void task_cputime(struct task_struct *t, cputime_t *utime, cputime_t *stime) { - if (utime) - *utime = t->utime; - if (stime) - *stime = t->stime; + *utime = t->utime; + *stime = t->stime; } static inline cputime_t task_gtime(struct task_struct *t) @@ -2265,10 +2263,8 @@ static inline void task_cputime_scaled(struct task_struct *t, cputime_t *utimescaled, cputime_t *stimescaled) { - if (utimescaled) - *utimescaled = t->utimescaled; - if (stimescaled) - *stimescaled = t->stimescaled; + *utimescaled = t->utimescaled; + *stimescaled = t->stimescaled; } #else static inline void task_cputime_scaled(struct task_struct *t, |