[2/2] devtools: forbid use of builtin helpers for bit count
Checks
Commit Message
Now that DPDK provides some bit count operations, flag it to avoid
reintroducing __builtin_*.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
devtools/checkpatches.sh | 8 ++++++++
1 file changed, 8 insertions(+)
Comments
On Fri, Aug 25, 2023 at 12:18:11PM +0200, David Marchand wrote:
> Now that DPDK provides some bit count operations, flag it to avoid
> reintroducing __builtin_*.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
@@ -127,6 +127,14 @@ check_forbidden_additions() { # <patch>
-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
"$1" || res=1
+ # forbid use of non abstracted bit count operations
+ awk -v FOLDERS="lib drivers app examples" \
+ -v EXPRESSIONS='\\<__builtin_(clz|clzll|ctz|ctzll|popcount|popcountll)\\>' \
+ -v RET_ON_FAIL=1 \
+ -v MESSAGE='Using __builtin helpers for bit count operations' \
+ -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
+ "$1" || res=1
+
# forbid use of experimental build flag except in examples
awk -v FOLDERS='lib drivers app' \
-v EXPRESSIONS='-DALLOW_EXPERIMENTAL_API allow_experimental_apis' \