[PATCH 2/2] devtools: forbid the use of ffs compiler builtins
David Marchand
david.marchand at redhat.com
Wed Oct 16 17:32:27 CEST 2024
On Wed, Oct 16, 2024 at 5:04 PM Stephen Hemminger
<stephen at networkplumber.org> wrote:
>
> On Wed, 16 Oct 2024 15:54:11 +0200
> Mattias Rönnblom <mattias.ronnblom at ericsson.com> wrote:
>
> > Extend checkpatches.sh to detect the use of __builtin_(ffs|ffsll).
> >
> > These intrinsics are not available in MSVC, and there are perfectly
> > serviceable alternatives in <rte_bitops.h>.
> >
> > Signed-off-by: Mattias Rönnblom <mattias.ronnblom at ericsson.com>
> > Suggested-by: David Marchand <david.marchand at redhat.com>
>
> Shouldn't this apply to all _builtin_ functions.
>
> There are a lot of drivers still doing this.
- The updated check here is about use of __builtin_XXX instead of DPDK
bit count ops.
So when you refer to all builtin functions, there may be other
builtins related to bit count we are missing, but at least the current
patch is better than before.
- On the larger topic of refusing *any* __builtin_, some use of them
are "legit" under compiler checks.
So the check would have to skip headers where wrappers are provided to
the rest of DPDK.
This seems possible, but a larger and probably more tricky change for now.
Are you ok if we go with this patch as is, in a first step?
--
David Marchand
More information about the dev
mailing list