diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2021-10-13 00:00:03 +0200 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2021-10-19 14:58:51 +0200 |
commit | 4d619e25abbd16eb76882e55cccf24ef6bad8a4e (patch) | |
tree | 8c032d0a0df0c89dfe5670fb39452519316dbe18 /tools | |
parent | build: add tests missed in .gitignore (diff) | |
download | frr-4d619e25abbd16eb76882e55cccf24ef6bad8a4e.tar.xz frr-4d619e25abbd16eb76882e55cccf24ef6bad8a4e.zip |
tools: add iterators to checkpatch
For the purpose of allowing the space in `frr_each (`, copy the list of
iterators from .clang-format and wire it up appropriately.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/checkpatch.pl | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/tools/checkpatch.pl b/tools/checkpatch.pl index cf15d0079..984112de0 100755 --- a/tools/checkpatch.pl +++ b/tools/checkpatch.pl @@ -409,6 +409,25 @@ our $Operators = qr{ }x; 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| + frr_with_mutex|frr_with_privs| + LIST_FOREACH|LIST_FOREACH_SAFE| + SLIST_FOREACH|SLIST_FOREACH_SAFE|SLIST_FOREACH_PREVPTR| + STAILQ_FOREACH|STAILQ_FOREACH_SAFE| + TAILQ_FOREACH|TAILQ_FOREACH_SAFE|TAILQ_FOREACH_REVERSE|TAILQ_FOREACH_REVERSE_SAFE| + RB_FOREACH|RB_FOREACH_SAFE|RB_FOREACH_REVERSE|RB_FOREACH_REVERSE_SAFE| + SPLAY_FOREACH| + FOR_ALL_INTERFACES|FOR_ALL_INTERFACES_ADDRESSES|JSON_FOREACH| + LY_FOR_KEYS|LY_LIST_FOR|LY_TREE_FOR|LY_TREE_DFS_BEGIN|LYD_TREE_DFS_BEGIN| + RE_DEST_FOREACH_ROUTE|RE_DEST_FOREACH_ROUTE_SAFE| + RNODE_FOREACH_RE|RNODE_FOREACH_RE_SAFE| + UPDGRP_FOREACH_SUBGRP|UPDGRP_FOREACH_SUBGRP_SAFE| + SUBGRP_FOREACH_PEER|SUBGRP_FOREACH_PEER_SAFE| + SUBGRP_FOREACH_ADJ|SUBGRP_FOREACH_ADJ_SAFE| + AF_FOREACH|FOREACH_AFI_SAFI|FOREACH_SAFI| + LSDB_LOOP + }x; our $BasicType; our $NonptrType; @@ -4028,7 +4047,8 @@ sub process { if|for|while|switch|return|case| volatile|__volatile__| __attribute__|format|__extension__| - asm|__asm__)$/x) + asm|__asm__| + $Iterators)$/x) { # cpp #define statements have non-optional spaces, ie # if there is a space between the name and the open |