lkml.org 
[lkml]   [2013]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] Fix __wait_on_atomic_t() to call the action func if the counter != 0
Date
Jeff Layton <jlayton@redhat.com> wrote:

> > @@ -333,7 +333,8 @@ int __wait_on_atomic_t(wait_queue_head_t *wq, struct wait_bit_queue *q,
> > prepare_to_wait(wq, &q->wait, mode);
> > val = q->key.flags;
> > if (atomic_read(val) == 0)
> > - ret = (*action)(val);
> > + break;
> > + ret = (*action)(val);
> > } while (!ret && atomic_read(val) != 0);
>
> nit: can you now eliminate the check for "val" in the while condition?
> It doesn't look like it harms anything, but eliminating it would
> probably simplify the code slightly...

Its presence means that we don't have to call prepare_to_wait() again if val
became 0.

David


\
 
 \ /
  Last update: 2013-07-23 20:21    [W:0.067 / U:1.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site