Re: [PATCH] nfp: convert nfp_eth_set_bit_config() into a macro

From: Jakub Kicinski
Date: Wed Oct 04 2017 - 19:26:01 EST


On Wed, 4 Oct 2017 16:16:49 -0700, Matthias Kaehlcke wrote:
> > > Thanks for the suggestion. This seems a viable alternative if David
> > > and the NFP owners can live without the extra checking provided by
> > > __BF_FIELD_CHECK.
> >
> > The reason the __BF_FIELD_CHECK refuses to compile non-constant masks
> > is that it will require runtime ffs on the mask, which is potentially
> > costly. I would also feel quite stupid adding those macros to the nfp
> > driver, given that I specifically created the bitfield.h header to not
> > have to reimplement these in every driver I write/maintain.
>
> That make sense, thanks for providing more context.
>
> > Can you please test the patch I provided in the other reply?
>
> With this patch there are no errors when building the kernel with
> clang.

Cool, thanks for checking! I will run it through full tests and queue
for upstreaming :)