Messages in this thread | | | Date | Mon, 9 Nov 2020 15:27:48 +0100 | From | Alexandre Belloni <> | Subject | Re: [PATCH v7 2/3] pinctrl: pinctrl-microchip-sgpio: Add pinctrl driver for Microsemi Serial GPIO |
| |
On 09/11/2020 16:00:16+0200, Andy Shevchenko wrote: > On Mon, Nov 9, 2020 at 2:07 PM Lars Povlsen <lars.povlsen@microchip.com> wrote: > > > On Thu, Oct 29, 2020 at 3:40 PM Lars Povlsen <lars.povlsen@microchip.com> 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
| |