kernel/sys.c: k_getrusage() can use while_each_thread()
authorOleg Nesterov <oleg@redhat.com>
Thu, 23 Jan 2014 23:55:55 +0000 (15:55 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 24 Jan 2014 00:37:02 +0000 (16:37 -0800)
Change k_getrusage() to use while_each_thread(), no changes in the
compiled code.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Kees Cook <keescook@chromium.org>
Reviewed-by: Sameer Nanda <snanda@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/sys.c

index ecd3ea12f72aa48d207ac9e02a251ade47bc3738..c0a58be780a407a5bf350e852db1c9800c98dd34 100644 (file)
@@ -1571,8 +1571,7 @@ static void k_getrusage(struct task_struct *p, int who, struct rusage *r)
                        t = p;
                        do {
                                accumulate_thread_rusage(t, r);
-                               t = next_thread(t);
-                       } while (t != p);
+                       } while_each_thread(p, t);
                        break;
 
                default: