]> git.proxmox.com Git - ovs.git/commitdiff
checkpatch: Check FOR_EACH loops with numbers.
authorIlya Maximets <i.maximets@samsung.com>
Fri, 12 Jul 2019 12:57:02 +0000 (15:57 +0300)
committerIlya Maximets <i.maximets@samsung.com>
Fri, 12 Jul 2019 16:22:14 +0000 (19:22 +0300)
OVS has defines for loops like 'BITMAP_FOR_EACH_1' or
'ULLONG_FOR_EACH_1', but the regexp in checkpatch doesn't match with
numbers and skips these loops while checking.

This patch adds numbers into regexp and adds some FER_EACH loops to
the unit tests.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Ben Pfaff <blp@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
tests/checkpatch.at
utilities/checkpatch.py

index 07f4b137c352d05669d49d1260dc36ea963a365d..f3b26dd341f29e1d445d89db5f980d5fc9626c9d 100755 (executable)
@@ -179,7 +179,7 @@ m4_define([COMMON_PATCH_HEADER], [dnl
 
 
 AT_SETUP([checkpatch - parenthesized constructs])
-for ctr in 'if' 'while' 'switch'; do
+for ctr in 'if' 'while' 'switch' 'HMAP_FOR_EACH' 'BITMAP_FOR_EACH_1'; do
 try_checkpatch \
    "COMMON_PATCH_HEADER
     +     $ctr (first_run) {
index ae86937c8fd8beaf3974feff453c0f2206ffd549..de5061406a60aac57a11b63b36e7365fdf88bd83 100755 (executable)
@@ -143,7 +143,7 @@ def reset_counters():
 # something in parentheses (usually an expression) then a left curly brace.
 #
 # 'do' almost qualifies but it's also used as "do { ... } while (...);".
-__parenthesized_constructs = 'if|for|while|switch|[_A-Z]+FOR_*EACH[_A-Z]*'
+__parenthesized_constructs = 'if|for|while|switch|[_A-Z]+FOR_*EACH[_A-Z0-9]*'
 
 __regex_added_line = re.compile(r'^\+{1,2}[^\+][\w\W]*')
 __regex_subtracted_line = re.compile(r'^\-{1,2}[^\-][\w\W]*')