diff options
| author | David Marchand <[email protected]> | 2024-10-25 09:04:19 +0200 |
|---|---|---|
| committer | David Marchand <[email protected]> | 2024-10-30 10:35:13 +0100 |
| commit | 8fa925fa206ef02de104cd4707db482731cf7e76 (patch) | |
| tree | b6c43207de09578e3bc775bf178793e1e1a43622 /devtools | |
| parent | 129f38c5b7ab4428ed94d088e3d3ef6a81807b55 (diff) | |
devtools: forbid use of builtin helpers
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 <[email protected]>
Acked-by: Stephen Hemminger <[email protected]>
Acked-by: Hemant Agrawal <[email protected]>
Diffstat (limited to 'devtools')
| -rwxr-xr-x | devtools/checkpatches.sh | 7 |
1 files 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 |
