diff options
author | Simon Glass <sjg@chromium.org> | 2012-09-27 15:33:46 +0000 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2012-10-15 11:54:04 -0700 |
commit | afb9bf55d093287458f4c2d3d2e42d90a7e91c95 (patch) | |
tree | 7041b343fddb94c93e624ddb818ed8cf8c65a82a | |
parent | ef0e9de82be6bb14e1a7c5c28f976c4fced12ed2 (diff) | |
download | u-boot-imx-afb9bf55d093287458f4c2d3d2e42d90a7e91c95.zip u-boot-imx-afb9bf55d093287458f4c2d3d2e42d90a7e91c95.tar.gz u-boot-imx-afb9bf55d093287458f4c2d3d2e42d90a7e91c95.tar.bz2 |
patman: Handle checkpatch.pl not providing file/line info
Sometimes we don't get a valid filename or line number from checkpatch.pl,
for example if the patch is in a bad format. Deal with this by using a
default value, rather than a stack trace.
Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | tools/patman/checkpatch.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/patman/checkpatch.py b/tools/patman/checkpatch.py index a234277..d831087 100644 --- a/tools/patman/checkpatch.py +++ b/tools/patman/checkpatch.py @@ -145,8 +145,9 @@ def CheckPatches(verbose, args): if len(problems) != error_count + warning_count: print "Internal error: some problems lost" for item in problems: - print GetWarningMsg(col, item['type'], item['file'], - item['line'], item['msg']) + print GetWarningMsg(col, item['type'], + item.get('file', '<unknown>'), + item.get('line', 0), item['msg']) #print stdout if error_count != 0 or warning_count != 0: str = 'checkpatch.pl found %d error(s), %d warning(s)' % ( |