On 09/11/2020 16:00:16+0200, Andy Shevchenko wrote: > On Mon, Nov 9, 2020 at 2:07 PM Lars Povlsen <lars.povlsen@xxxxxxxxxxxxx> wrote: > > > On Thu, Oct 29, 2020 at 3:40 PM Lars Povlsen <lars.povlsen@xxxxxxxxxxxxx> wrote: > > ... > > > >> +#define __shf(x) (__builtin_ffs(x) - 1) > > >> +#define __BF_PREP(bf, x) (bf & ((x) << __shf(bf))) > > >> +#define __BF_GET(bf, x) (((x & bf) >> __shf(bf))) > > > > > > Isn't it home grown reimplementation of bitfield.h? > > > > This was answered in the aforementioned mail. > > Perhaps it makes sense to add functions like field_get(), field_prep() > to that header? IIRC it has been explicitly excluded from bitfield.h to ensure developers will think about the introduced overhead. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com