2 # SPDX-License-Identifier: BSD-3-Clause
3 # Copyright 2015-2020 Mellanox Technologies, Ltd
5 # Apply coccinelle transforms.
7 SRCTREE=$(readlink -f $(dirname $0)/..)
8 COCCI=$SRCTREE/devtools/cocci
9 [ -n "$SPATCH" ] || SPATCH=$(which spatch)
12 [ -n "$PATCH_LIST" ] || PATCH_LIST=$(echo $COCCI/*.cocci)
15 echo "Coccinelle tools not installed."
19 tmp=$(mktemp -t dpdk.cocci.XXX)
21 for c in $PATCH_LIST; do
23 echo -n "Applying $c..."
24 $SPATCH --sp-file $c -c --linux-spacing --very-quiet \
25 --include-headers --preprocess \
26 --in-place --dir $SRCTREE > $tmp
28 echo " changes applied, retrying."