From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, ferruh.yigit@amd.com,
stephen@networkplumber.org, mattias.ronnblom@ericsson.com
Subject: [PATCH 2/6] devtools: forbid use of builtin helpers
Date: Thu, 24 Oct 2024 14:05:31 +0200 [thread overview]
Message-ID: <20241024120535.2722316-3-david.marchand@redhat.com> (raw)
In-Reply-To: <20241024120535.2722316-1-david.marchand@redhat.com>
Warn on use of any __builtin helpers, but leave it open for EAL (as it
is where the abstractions for OS and compiler differences are), and
some drivers base code.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
devtools/checkpatches.sh | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index d860f19045..4a8591be22 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -177,11 +177,12 @@ check_forbidden_additions() { # <patch>
-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
"$1" || res=1
- # forbid use of non abstracted bit count operations
+ # forbid use of compiler __builtin_*
awk -v FOLDERS="lib drivers app examples" \
- -v EXPRESSIONS='\\<__builtin_(clz|ctz|ffs|popcount)(ll)?\\>' \
+ -v SKIP_FILES='lib/eal/ drivers/.*/base/ drivers/.*osdep.h$' \
+ -v EXPRESSIONS='\\<__builtin_' \
-v RET_ON_FAIL=1 \
- -v MESSAGE='Using __builtin helpers for bit count operations' \
+ -v MESSAGE='Using __builtin helpers, prefer EAL macros' \
-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
"$1" || res=1
--
2.46.2
next prev parent reply other threads:[~2024-10-24 12:05 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-24 12:05 [PATCH 0/6] Clean up many __builtin_* in drivers David Marchand
2024-10-24 12:05 ` [PATCH 1/6] devtools: handle multiple pattern for skipping files David Marchand
2024-10-24 12:05 ` David Marchand [this message]
2024-10-24 16:40 ` [PATCH 2/6] devtools: forbid use of builtin helpers Stephen Hemminger
2024-10-24 12:05 ` [PATCH 3/6] common/dpaax: use prefetch macros David Marchand
2024-10-24 16:40 ` Stephen Hemminger
2024-10-24 12:05 ` [PATCH 4/6] crypto/openssl: fix 3DES-CTR with big endian CPUs David Marchand
2024-10-24 12:54 ` Morten Brørup
2024-10-24 13:10 ` David Marchand
2024-10-24 13:17 ` David Marchand
2024-10-24 13:30 ` David Marchand
2024-10-24 14:21 ` Morten Brørup
2024-10-24 12:05 ` [PATCH 5/6] drivers: use branch prediction macros David Marchand
2024-10-24 16:41 ` Stephen Hemminger
2024-10-24 12:05 ` [PATCH 6/6] drivers: use bitops API instead of compiler builtins David Marchand
2024-10-24 12:25 ` Morten Brørup
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241024120535.2722316-3-david.marchand@redhat.com \
--to=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@amd.com \
--cc=mattias.ronnblom@ericsson.com \
--cc=stephen@networkplumber.org \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).