diff options
author | Matthias Kaehlcke <matthias.kaehlcke@gmail.com> | 2007-10-19 02:39:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-19 14:53:38 -0400 |
commit | 7b1915a989ea4d426d0fd98974ab80f30ef1d779 (patch) | |
tree | b643758364628db742c3bdd27d0d36c9a39a95a5 /mm/oom_kill.c | |
parent | 2e1975868ac9d41211fcaa6f2c5e44c4e7ff9e5b (diff) |
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: 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>
Diffstat (limited to 'mm/oom_kill.c')
-rw-r--r-- | mm/oom_kill.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c index b1c2d0f86222..a7cb4c43fd11 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c | |||
@@ -337,7 +337,6 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order, | |||
337 | unsigned long points, const char *message) | 337 | unsigned long points, const char *message) |
338 | { | 338 | { |
339 | struct task_struct *c; | 339 | struct task_struct *c; |
340 | struct list_head *tsk; | ||
341 | 340 | ||
342 | if (printk_ratelimit()) { | 341 | if (printk_ratelimit()) { |
343 | printk(KERN_WARNING "%s invoked oom-killer: " | 342 | 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 | message, p->pid, p->comm, points); | 359 | message, p->pid, p->comm, points); |
361 | 360 | ||
362 | /* Try to kill a child first */ | 361 | /* Try to kill a child first */ |
363 | list_for_each(tsk, &p->children) { | 362 | list_for_each_entry(c, &p->children, sibling) { |
364 | c = list_entry(tsk, struct task_struct, sibling); | ||
365 | if (c->mm == p->mm) | 363 | if (c->mm == p->mm) |
366 | continue; | 364 | continue; |
367 | if (!oom_kill_task(c)) | 365 | if (!oom_kill_task(c)) |