[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wiy87EzKRXRa3VkgesGndrR02pizpX_TEzP+cPPJytpWg@mail.gmail.com>
Date:   Thu, 5 Dec 2019 15:58:30 -0800
From:   Linus Torvalds <torvalds@...ux-foundation.org>
To:     David Howells <dhowells@...hat.com>
Cc:     Eric Biggers <ebiggers@...nel.org>,
        Al Viro <viro@...iv.linux.org.uk>,
        linux-fsdevel <linux-fsdevel@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] pipe: Fix missing mask update after pipe_wait() [ver #2]
On Thu, Dec 5, 2019 at 2:30 PM David Howells <dhowells@...hat.com> wrote:
>
> -               struct pipe_buffer *buf = &pipe->bufs[(head - 1) & mask];
> +               struct pipe_buffer *buf =
> +                       &pipe->bufs[(head - 1) & (pipe->ring_size - 1)];
I changed the two occurrences of this to use a local temporary "mask"
variable, to avoid the long lines.
It's no longer _caching_ the value, but it makes the code more legible.
              Linus
Powered by blists - more mailing lists
 
