[ovs-dev] [PATCH] checkpatch: Fix inconsistencies skipping datapath files.

Ben Pfaff blp at ovn.org
Mon May 8 14:50:12 UTC 2017


The code in checkpatch inconsistently stripped "a/" or "b/" from the
beginning of a file name, and the check for "datapath" only worked when
the prefix was not stripped.  This fixes the problem.

CC: Aaron Conole <aconole at redhat.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>
---
 utilities/checkpatch.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
index 387549afe3f6..d486de81c8ff 100755
--- a/utilities/checkpatch.py
+++ b/utilities/checkpatch.py
@@ -277,7 +277,7 @@ def ovs_checkpatch_parse(text):
             match = hunks.match(line)
             if match:
                 parse = parse + 1
-                current_file = match.group(2)
+                current_file = match.group(2)[2:]
                 print_file_name = current_file
             continue
         elif parse == 0:
@@ -318,7 +318,7 @@ def ovs_checkpatch_parse(text):
 
             # Skip files which have /datapath in them, since they are
             # linux or windows coding standards
-            if '/datapath' in current_file:
+            if current_file.startswith('datapath'):
                 continue
             run_checks(current_file, cmp_line, lineno)
     if __errors or __warnings:
-- 
2.10.2



More information about the dev mailing list