Re: [PATCH 2/3] mm, slab: use an enum to define SLAB_ cache creation flags

Vlastimil Babka
2024-02-23T16:42:34Z

On 2/21/24 19:33, Roman Gushchin wrote:
> On Tue, Feb 20, 2024 at 05:58:26PM +0100, Vlastimil Babka wrote:
>> The values of SLAB_ cache creation flagsare defined by hand, which is
>> tedious and error-prone. Use an enum to assign the bit number and a
>> __SF_BIT() macro to #define the final flags.
>>
>> This renumbers the flag values, which is OK as they are only used
>> internally.
>>
>> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
>> +#define __SF_BIT(nr) ((slab_flags_t __force)(1U << (nr)))
>
> I'd rename it to (__)SLAB_FLAG_BIT(), as SF is a bit cryptic, but not a strong
> preference. Otherwise looks really good to me, nice cleanup.

OK, it's also less likely that somebody would collide it.

> Reviewed-by: Roman Gushchin <roman.gushchin@linux.dev>
>
> Thanks!