C++ has a different style when it comes to space around references,
dereferences, so don't report it.
Also, closing templates with >> gets wrongly confused with >> operator,
so just relax this check.

Signed-off-by: Pierrick Bouvier <[email protected]>
---
 scripts/checkpatch.pl | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 2189db19f54..c74ec070c53 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2621,6 +2621,23 @@ sub process {
                                                if ($op eq '::') {
                                                        $ok = 1;
                                                }
+
+                                               # Ignore * in C++
+                                               if ($op eq '*') {
+                                                       $ok = 1;
+                                               }
+
+                                               # Ignore & in C++
+                                               if ($op eq '&') {
+                                                       $ok = 1;
+                                               }
+
+                                               # Ignore >> in C++
+                                               # checkpatch is confused by
+                                               # >> closing templates
+                                               if ($op eq '>>') {
+                                                       $ok = 1;
+                                               }
                                        }
 
                                        # Ignore email addresses <foo@bar>
-- 
2.43.0


Reply via email to