Messages in this thread | | | Subject | Re: [PATCH] slab.h: Avoid using & for logical and of booleans | From | William Kucharski <> | Date | Tue, 6 Nov 2018 02:45:28 -0700 |
| |
> 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
| |