lkml.org 
[lkml]   [2018]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] slab.h: Avoid using & for logical and of booleans
From
Date


> On Nov 5, 2018, at 14:13, Andrew Morton <akpm@linux-foundation.org> wrote:
>
>> On Mon, 5 Nov 2018 12:40:00 -0800 Bart Van Assche <bvanassche@acm.org> wrote:
>> - return type_dma + (is_reclaimable & !is_dma) * KMALLOC_RECLAIM;
>> + return type_dma + is_reclaimable * !is_dma * KMALLOC_RECLAIM;
>> }
>>
>> /*
>
> I suppose so.
>
> That function seems too clever for its own good :(. I wonder if these
> branch-avoiding tricks are really worthwhile.

At the very least I'd like to see some comments added as to why that approach was taken for the sake of future maintainers.

William Kucharski


\
 
 \ /
  Last update: 2018-11-06 10:46    [W:0.165 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site