[ovs-dev] [PATCH v2 2/7] checkpatch: Print the line in question distinctly

Aaron Conole aconole at bytheb.org
Fri Oct 21 18:49:04 UTC 2016


This makes it easier to distinguish between the line, and
the warning/error message.

Signed-off-by: Aaron Conole <aconole at bytheb.org>
---
 utilities/checkpatch.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
index 15b59a3..5fbac9a 100755
--- a/utilities/checkpatch.py
+++ b/utilities/checkpatch.py
@@ -250,6 +250,7 @@ def usage():
 
 
 def ovs_checkpatch_file(filename):
+    global __warnings, __errors
     try:
         mail = email.message_from_file(open(filename, 'r'))
     except:
@@ -259,7 +260,10 @@ def ovs_checkpatch_file(filename):
     for part in mail.walk():
         if part.get_content_maintype() == 'multipart':
             continue
-        return ovs_checkpatch_parse(part.get_payload(decode=True))
+    result = ovs_checkpatch_parse(part.get_payload(decode=True))
+    if result < 0:
+        print("Warnings: %d, Errors: %d" % (__warnings, __errors))
+    return result
 
 if __name__ == '__main__':
     try:
-- 
2.7.4




More information about the dev mailing list