Skip to content

Commit

Permalink
mm/oom_kill.c: Use list_for_each_entry instead of list_for_each
Browse files Browse the repository at this point in the history
mm/oom_kill.c: Convert list_for_each to list_for_each_entry in
oom_kill_process()

Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Matthias Kaehlcke authored and Linus Torvalds committed Oct 19, 2007
1 parent 2e19758 commit 7b1915a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions mm/oom_kill.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,6 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
unsigned long points, const char *message)
{
struct task_struct *c;
struct list_head *tsk;

if (printk_ratelimit()) {
printk(KERN_WARNING "%s invoked oom-killer: "
Expand All @@ -360,8 +359,7 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
message, p->pid, p->comm, points);

/* Try to kill a child first */
list_for_each(tsk, &p->children) {
c = list_entry(tsk, struct task_struct, sibling);
list_for_each_entry(c, &p->children, sibling) {
if (c->mm == p->mm)
continue;
if (!oom_kill_task(c))
Expand Down

0 comments on commit 7b1915a

Please sign in to comment.