Lance pointed to a problem where scripts were incorrectly being flagged as
pointer spacing warnings.  As an example, the text:

  --u*|-u)

would flag the warning.

Since the type name should always have a space in front of it, change the
regex to require some spacing.  Additionally, ** is a common notation in
comments to mean 'raise to the power of', so ensure that it is not
accidentally flagged as well by adding a not-group populated with *.

Reported-by: Lance Richardson <[email protected]>
Signed-off-by: Aaron Conole <[email protected]>
---
 utilities/checkpatch.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
index 638ac97..31cbce2 100755
--- a/utilities/checkpatch.py
+++ b/utilities/checkpatch.py
@@ -68,7 +68,8 @@ __regex_is_for_if_single_line_bracket = \
     re.compile(r'^ +(if|for|while) \(.*\)')
 __regex_ends_with_bracket = \
     re.compile(r'[^\s]\) {(\s+/\*[\s\Sa-zA-Z0-9\.,\?\*/+-]*)?$')
-__regex_ptr_declaration_missing_whitespace = re.compile(r'[a-zA-Z0-9]\*')
+__regex_ptr_declaration_missing_whitespace = \
+    re.compile(r'\s[a-zA-Z0-9_]+\*[^*]')
 
 skip_leading_whitespace_check = False
 skip_trailing_whitespace_check = False
-- 
2.9.3

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

Reply via email to