Skip to content

Commit 324d666

Browse files
Chen Gangtorvalds
authored andcommitted
kernel/delayacct.c: remove redundant checking in __delayacct_add_tsk()
The wrapper function delayacct_add_tsk() already checked 'tsk->delays', and __delayacct_add_tsk() has no another direct callers, so can remove the redundancy checking code. And the label 'done' is also useless, so remove it, too. Signed-off-by: Chen Gang <gang.chen@asianux.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent c725ee5 commit 324d666

1 file changed

Lines changed: 0 additions & 7 deletions

File tree

‎kernel/delayacct.c‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,6 @@ int __delayacct_add_tsk(struct taskstats *d, struct task_struct *tsk)
108108
struct timespec ts;
109109
cputime_t utime, stime, stimescaled, utimescaled;
110110

111-
/* Though tsk->delays accessed later, early exit avoids
112-
* unnecessary returning of other data
113-
*/
114-
if (!tsk->delays)
115-
goto done;
116-
117111
tmp = (s64)d->cpu_run_real_total;
118112
task_cputime(tsk, &utime, &stime);
119113
cputime_to_timespec(utime + stime, &ts);
@@ -158,7 +152,6 @@ int __delayacct_add_tsk(struct taskstats *d, struct task_struct *tsk)
158152
d->freepages_count += tsk->delays->freepages_count;
159153
spin_unlock_irqrestore(&tsk->delays->lock, flags);
160154

161-
done:
162155
return 0;
163156
}
164157

0 commit comments

Comments
 (0)