Current regexp used to check whitespaces around operators does not
consider that there can be more than one "*" together to express pointer
to pointer. As a result, false positive warnings are raised [1].

Fix the regexp to allow more than one consecutive "+" characters.

Signed-off-by: Adrian Moreno <[email protected]>

[1] Example of patch triggering false positives:
> cat <<EOF | ./utilities/checkpatch.py -s
diff --git a/test.c b/test.c
--- a/test.c
+++ b/test.c
@@ -1 +1,2 @@
+static void foo(struct oftable ***list, char **errorp);
EOF

WARNING: Line lacks whitespace around operator
static void foo(struct oftable ***list, char **errorp);

Lines checked: 6, Warnings: 1, Errors: 0
---
 utilities/checkpatch.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
index 6b293770d..891b24dcf 100755
--- a/utilities/checkpatch.py
+++ b/utilities/checkpatch.py
@@ -739,7 +739,7 @@ infix_operators = \
             '&=', '^=', '|=', '<<=', '>>=']] \
     + [r'[^<" ]<[^=" ]',
        r'[^\->" ]>[^=" ]',
-       r'[^ !()/"]\*[^/]',
+       r'[^ !()/"\*]\*[^/]',
        r'[^ !&()"]&',
        r'[^" +(]\+[^"+;]',
        r'[^" \-(]\-[^"\->;]',
-- 
2.45.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to