[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241118111314.58481-1-dheeraj.linuxdev@gmail.com>
Date: Mon, 18 Nov 2024 16:43:14 +0530
From: Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@...il.com>
To: mingo@...hat.com,
peterz@...radead.org,
juri.lelli@...hat.com,
vincent.guittot@...aro.org,
linux-kernel@...r.kernel.org
Cc: dietmar.eggemann@....com,
rostedt@...dmis.org,
bsegall@...gle.com,
mgorman@...e.de,
vschneid@...hat.com,
Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@...il.com>
Subject: [PATCH sched-next] sched/cputime: Fix unused value issue
This commit fixes an unused value issue detected by Coverity
(CID 1357987). The value of utime is updated but has no use as it is
updated later on without using the stored value.
Signed-off-by: Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@...il.com>
---
kernel/sched/cputime.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c
index 0bed0fa1acd9..3dea3636a260 100644
--- a/kernel/sched/cputime.c
+++ b/kernel/sched/cputime.c
@@ -571,13 +571,9 @@ void cputime_adjust(struct task_cputime *curr, struct prev_cputime *prev,
* Once a task gets some ticks, the monotonicity code at 'update:'
* will ensure things converge to the observed ratio.
*/
- if (stime == 0) {
- utime = rtime;
- goto update;
- }
-
- if (utime == 0) {
- stime = rtime;
+ if (stime == 0 || utime == 0) {
+ if (utime == 0)
+ stime = rtime;
goto update;
}
--
2.34.1
Powered by blists - more mailing lists