sched/cputime: Refactor the cputime_adjust() code
authorGustavo A. R. Silva <garsilva@embeddedor.com>
Thu, 29 Jun 2017 18:41:28 +0000 (13:41 -0500)
committerIngo Molnar <mingo@kernel.org>
Fri, 30 Jun 2017 07:37:59 +0000 (09:37 +0200)
commit72298e5c92c50edd8cb7cfda4519483ce65fa166
treecd927a0333b4b8c66ec619acdfcee4525ff46ff5
parent48365b38849fdb1ee6dc65beac044ca59f669683
sched/cputime: Refactor the cputime_adjust() code

Address a Coverity false positive, which is caused by overly
convoluted code:

Value assigned to variable 'utime' at line 619:utime = rtime;
is overwritten at line 642:utime = rtime - stime; before it
can be used. This makes such variable assignment useless.

Remove this variable assignment and refactor the code related.

Addresses-Coverity-ID: 1371643
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Cc: Frans Klaver <fransklaver@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Wanpeng Li <wanpeng.li@hotmail.com>
Link: http://lkml.kernel.org/r/20170629184128.GA5271@embeddedgus
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/sched/cputime.c