From: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
To: akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 4/5] mm/oom_kill.c: Use list_for_each_entry instead of list_for_each
Date: Sun, 22 Jul 2007 20:54:07 +0200 [thread overview]
Message-ID: <20070722185407.GJ27415@traven> (raw)
In-Reply-To: <20070722184202.GF27415@traven>
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>
--
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index a700141..b1851c4 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -347,7 +347,6 @@ static int oom_kill_process(struct task_struct *p, unsigned long points,
const char *message)
{
struct task_struct *c;
- struct list_head *tsk;
/*
* If the task is already exiting, don't alarm the sysadmin or kill
@@ -362,8 +361,7 @@ static int oom_kill_process(struct task_struct *p, unsigned long points,
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))
--
Matthias Kaehlcke
Linux Application Developer
Barcelona
Ma patrie est où je suis, où personne ne me dérange, où personne
ne me demande que je suis, d'où je viens et ce que je fais
(B. Traven)
.''`.
using free software / Debian GNU/Linux | http://debian.org : :' :
`. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4 `-
next prev parent reply other threads:[~2007-07-22 18:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-22 18:42 [PATCH 0/5] Use list_for_each_entry(_safe) instead of list_for_each(_safe) Matthias Kaehlcke
2007-07-22 18:49 ` [PATCH 1/5] kernel/exit.c: " Matthias Kaehlcke
2007-07-22 18:51 ` [PATCH 2/5] kernel/time/clocksource.c: Use list_for_each_entry instead of list_for_each Matthias Kaehlcke
2007-07-22 18:52 ` [PATCH 3/5] kernel/user.c: " Matthias Kaehlcke
2007-07-22 18:54 ` Matthias Kaehlcke [this message]
2007-07-22 18:56 ` [PATCH 5/5] mm/page_alloc.c: " Matthias Kaehlcke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070722185407.GJ27415@traven \
--to=matthias.kaehlcke@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox