From 65c6733a679eb4cc3b6dc00af75bc65280422775 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Date: Wed, 16 Oct 2024 15:54:11 +0200 Subject: [PATCH] devtools: forbid more builtin helpers for bit count MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 . Suggested-by: David Marchand Signed-off-by: Mattias Rönnblom Signed-off-by: David Marchand --- devtools/checkpatches.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh index c23792025ae..d860f190457 100755 --- a/devtools/checkpatches.sh +++ b/devtools/checkpatches.sh @@ -179,7 +179,7 @@ check_forbidden_additions() { # # 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 EXPRESSIONS='\\<__builtin_(clz|ctz|ffs|popcount)(ll)?\\>' \ -v RET_ON_FAIL=1 \ -v MESSAGE='Using __builtin helpers for bit count operations' \ -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \