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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
>> +#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@xxxxxxxxx>
> 
> Thanks!





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux