Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=03ff17979c58a0b63b0fe30a373f41b719731bd2
Commit:     03ff17979c58a0b63b0fe30a373f41b719731bd2
Parent:     d473012710b815741043942bc41945d444abab40
Author:     Matthias Kaehlcke <[EMAIL PROTECTED]>
AuthorDate: Thu Oct 18 23:39:57 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Fri Oct 19 11:53:38 2007 -0700

    kernel/exit.c: Use list_for_each_entry(_safe) instead of 
list_for_each(_safe)
    
    kernel/exit.c: Convert list_for_each(_safe) to
    list_for_each_entry(_safe) in forget_original_parent(), exit_notify()
    and do_wait()
    
    Signed-off-by: Matthias Kaehlcke <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 kernel/exit.c |   19 ++++++-------------
 1 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/kernel/exit.c b/kernel/exit.c
index db97641..c5d97af 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -669,8 +669,7 @@ reparent_thread(struct task_struct *p, struct task_struct 
*father, int traced)
 static void
 forget_original_parent(struct task_struct *father, struct list_head 
*to_release)
 {
-       struct task_struct *p, *reaper = father;
-       struct list_head *_p, *_n;
+       struct task_struct *p, *n, *reaper = father;
 
        do {
                reaper = next_thread(reaper);
@@ -688,9 +687,8 @@ forget_original_parent(struct task_struct *father, struct 
list_head *to_release)
         *
         * Search them and reparent children.
         */
-       list_for_each_safe(_p, _n, &father->children) {
+       list_for_each_entry_safe(p, n, &father->children, sibling) {
                int ptrace;
-               p = list_entry(_p, struct task_struct, sibling);
 
                ptrace = p->ptrace;
 
@@ -718,8 +716,7 @@ forget_original_parent(struct task_struct *father, struct 
list_head *to_release)
                if (unlikely(ptrace && p->exit_state == EXIT_ZOMBIE && 
p->exit_signal == -1))
                        list_add(&p->ptrace_list, to_release);
        }
-       list_for_each_safe(_p, _n, &father->ptrace_children) {
-               p = list_entry(_p, struct task_struct, ptrace_list);
+       list_for_each_entry_safe(p, n, &father->ptrace_children, ptrace_list) {
                p->real_parent = reaper;
                reparent_thread(p, father, 1);
        }
@@ -1518,12 +1515,9 @@ repeat:
        tsk = current;
        do {
                struct task_struct *p;
-               struct list_head *_p;
                int ret;
 
-               list_for_each(_p,&tsk->children) {
-                       p = list_entry(_p, struct task_struct, sibling);
-
+               list_for_each_entry(p, &tsk->children, sibling) {
                        ret = eligible_child(pid, options, p);
                        if (!ret)
                                continue;
@@ -1605,9 +1599,8 @@ check_continued:
                        }
                }
                if (!flag) {
-                       list_for_each(_p, &tsk->ptrace_children) {
-                               p = list_entry(_p, struct task_struct,
-                                               ptrace_list);
+                       list_for_each_entry(p, &tsk->ptrace_children,
+                                           ptrace_list) {
                                if (!eligible_child(pid, options, p))
                                        continue;
                                flag = 1;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to