Re: [PATCH 2/2] pipe: Fix missing mask update after pipe_wait() [ver #2]

From: Linus Torvalds
Date: Thu Dec 05 2019 - 18:58:51 EST


On Thu, Dec 5, 2019 at 2:30 PM David Howells <dhowells@xxxxxxxxxx> 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