lkml.org 
[lkml]   [2018]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] block: respect virtual boundary mask in bvecs
On Wed, Nov 07, 2018 at 08:10:19AM -0800, Bart Van Assche wrote:
> > I personally not a huge fan of decoding complicated expressions. But if
> > others are fine with it then I am too...
>
> What I proposed is not a new pattern. It is a pattern that is already used
> elsewhere in the Linux kernel. A few examples:
>
> >From dmabounce.c:
>
> /* Figure out if we need to bounce from the DMA mask. */
> if ((dma_addr | (dma_addr + size - 1)) & ~mask)
> return 1;
>
> >From dma-direct.h:
>
> if ((addr | (addr + size - 1)) & ~mask)
> return 0;

Time for a well documented helper :)

\
 
 \ /
  Last update: 2018-11-08 16:05    [W:0.058 / U:5.820 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site