[PATCH] sched/cputime: Remove unnecessary assignment statement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The original code assigns the value from rtime to utime variable,
and then jumps to the update label. And the value of utime is then
updated, so the earlier value of utime is not used. Hence remove
that unnecessary assignment statement.

This fixes one of the coverity defects.

Based on work by Ishan Mittal <imittal@xxxxxxxxxx>

Signed-off-by: Ketan Patil <ketanp@xxxxxxxxxx>
---
 kernel/sched/cputime.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c
index ba4a143..ad64771 100644
--- a/kernel/sched/cputime.c
+++ b/kernel/sched/cputime.c
@@ -616,10 +616,8 @@ void cputime_adjust(struct task_cputime *curr, struct prev_cputime *prev,
 	 * Once a task gets some ticks, the monotonicy code at 'update:'
 	 * will ensure things converge to the observed ratio.
 	 */
-	if (stime == 0) {
-		utime = rtime;
+	if (stime == 0)
 		goto update;
-	}
 
 	if (utime == 0) {
 		stime = rtime;
-- 
2.7.4




[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux