[PATCH 6/6] devtools: forbid new direct use of GCC atomic builtins

Morten Brørup mb at smartsharesystems.com
Fri Aug 11 11:51:17 CEST 2023


> From: Tyler Retzlaff [mailto:roretzla at linux.microsoft.com]
> Sent: Friday, 11 August 2023 03.32
> 
> Refrain from using compiler __atomic_xxx builtins DPDK now requires
> the use of rte_atomic_<op>_explicit macros when operating on DPDK
> atomic variables.
> 
> Signed-off-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
> Acked-by: Morten Brørup <mb at smartsharesystems.com>

The Acked-by should have been:
Suggested-by: Morten Brørup <mb at smartsharesystems.com>

> ---
>  devtools/checkpatches.sh | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
> index 43f5e36..a32f02e 100755
> --- a/devtools/checkpatches.sh
> +++ b/devtools/checkpatches.sh
> @@ -102,6 +102,14 @@ check_forbidden_additions() { # <patch>
>  		-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk
> \
>  		"$1" || res=1
> 
> +	# refrain from using compiler __atomic_xxx builtins
> +	awk -v FOLDERS="lib drivers app examples" \
> +		-v EXPRESSIONS="__atomic_.*\\\(" \

This expression is a superset of other expressions in checkpatches (search for "__atomic" in the checkpatches, and you'll find them). Perhaps they can be removed?

> +		-v RET_ON_FAIL=1 \
> +		-v MESSAGE='Using __atomic_xxx builtins' \
> +		-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk
> \
> +		"$1" || res=1
> +
>  	# refrain from using compiler __atomic_thread_fence()
>  	# It should be avoided on x86 for SMP case.
>  	awk -v FOLDERS="lib drivers app examples" \
> --
> 1.8.3.1



More information about the dev mailing list