From bec10915a4a36c392145c6d9013904a928cf7855 Mon Sep 17 00:00:00 2001 From: Christian Hopps Date: Tue, 24 Oct 2023 14:58:11 -0400 Subject: [PATCH] tools: checkpatch updated with darr_foreach iter macros Also update `checkpatch.sh` so it runs `checkpatch.pl` from the same directory it resides in. This allows copying them both somewhere else to use a specific version. Signed-off-by: Christian Hopps --- tools/checkpatch.pl | 2 +- tools/checkpatch.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/checkpatch.pl b/tools/checkpatch.pl index 3e8a6b392a3e..e3788bde16b6 100755 --- a/tools/checkpatch.pl +++ b/tools/checkpatch.pl @@ -547,7 +547,7 @@ sub hash_show_words { our $c90_Keywords = qr{do|for|while|if|else|return|goto|continue|switch|default|case|break}x; our $Iterators = qr{ - frr_each|frr_each_safe|frr_each_from| + darr_foreach_p|darr_foreach_i|frr_each|frr_each_safe|frr_each_from| frr_with_mutex|frr_with_privs| LIST_FOREACH|LIST_FOREACH_SAFE| SLIST_FOREACH|SLIST_FOREACH_SAFE|SLIST_FOREACH_PREVPTR| diff --git a/tools/checkpatch.sh b/tools/checkpatch.sh index 6071f4804d9e..bf63057b0219 100755 --- a/tools/checkpatch.sh +++ b/tools/checkpatch.sh @@ -3,7 +3,8 @@ usage="./checkpatch.sh " patch=$1 tree=$2 -checkpatch="$tree/tools/checkpatch.pl --no-tree -f" +scriptdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)" +checkpatch="$scriptdir/checkpatch.pl --no-tree -f" ignore="ldpd\|babeld" cwd=${PWD##*/} dirty=0