Re: [PATCH 2/3] k_getrusage() can use while_each_thread()

Sameer Nanda
2013-11-22T20:16:52Z

On Fri, Nov 22, 2013 at 11:18 AM, Oleg Nesterov <oleg@redhat.com> wrote:
> Change k_getrusage() to use while_each_thread(), no changes in
> the compiled code.
>
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Sameer Nanda <snanda@chromium.org>

> ---
> kernel/sys.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/sys.c b/kernel/sys.c
> index 1d9a218..70d56d6 100644
> --- a/kernel/sys.c
> +++ b/kernel/sys.c
> @@ -1572,8 +1572,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:
> --
> 1.5.5.1
>