Commit 7b1915a9 authored by Matthias Kaehlcke's avatar Matthias Kaehlcke Committed by Linus Torvalds

mm/oom_kill.c: Use list_for_each_entry instead of list_for_each

mm/oom_kill.c: Convert list_for_each to list_for_each_entry in
oom_kill_process()
Signed-off-by: default avatarMatthias Kaehlcke <matthias.kaehlcke@gmail.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2e197586
...@@ -337,7 +337,6 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order, ...@@ -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) unsigned long points, const char *message)
{ {
struct task_struct *c; struct task_struct *c;
struct list_head *tsk;
if (printk_ratelimit()) { if (printk_ratelimit()) {
printk(KERN_WARNING "%s invoked oom-killer: " printk(KERN_WARNING "%s invoked oom-killer: "
...@@ -360,8 +359,7 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order, ...@@ -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); message, p->pid, p->comm, points);
/* Try to kill a child first */ /* Try to kill a child first */
list_for_each(tsk, &p->children) { list_for_each_entry(c, &p->children, sibling) {
c = list_entry(tsk, struct task_struct, sibling);
if (c->mm == p->mm) if (c->mm == p->mm)
continue; continue;
if (!oom_kill_task(c)) if (!oom_kill_task(c))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment