On Fri, 9 Nov 2018 10:35:34 +0100 Johannes Berg <[email protected]> wrote:
> The operation here really is more logical than bitwise, even if > due to the setup the bitwise operation works fine. However, this > causes a complaint from sparse that the operation doesn't really > make sense due to the not. > > Use a logical and instead of bitwise. > > In my (somewhat unscientific) test this caused no differences in > the generated code. > > ... > > --- a/include/linux/slab.h > +++ b/include/linux/slab.h > @@ -329,7 +329,7 @@ static __always_inline enum kmalloc_cache_type > kmalloc_type(gfp_t flags) > * If an allocation is both __GFP_DMA and __GFP_RECLAIMABLE, return > * KMALLOC_DMA and effectively ignore __GFP_RECLAIMABLE > */ > - return type_dma + (is_reclaimable & !is_dma) * KMALLOC_RECLAIM; > + return type_dma + (is_reclaimable && !is_dma) * KMALLOC_RECLAIM; > } > > /* Thanks. There's presently a bit of head-scratching going on over this. http://lkml.kernel.org/r/[email protected] - please feel free to weigh in ;)

