From 8a6f91d5886db6c747b01a6b0af93fa3f670ea5e Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Wed, 14 Jul 2010 20:27:48 +0400 Subject: [PATCH] Improve nn-check.py output to be less verbose. Don't complain about common english words that may be in comments. Require that "up", "down", and "completion" be used as functions with opening "(" before they are flagged. I thought about, and rejected, discarding all comments, but it still makes sense to clean up non-portable function names in comments. --- build/nn-check.py | 16 ++++++++-------- build/nn-final-symbol-list.txt | 9 +++++---- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/build/nn-check.py b/build/nn-check.py index 12d28aa..dcb281a 100755 --- a/build/nn-check.py +++ b/build/nn-check.py @@ -58,16 +58,11 @@ def search_symbol(line, linenum): if regex_match: print_symbol = regex_match.group(0) - print 'WARNING: Found %s at line %d:' \ + print 'warning: Found %s at line %d:' \ % (print_symbol, linenum) print '%s' % line.rstrip() bad_symbol_cnt += 1 -# The main portion of the script -print '=================' -print 'Starting nn-check' -print '=================' - # Open the nn-final-symbol-list.txt file and pull in the symbols to check into # a dictionary object. try: @@ -95,7 +90,12 @@ except IOError: print 'Check the path provided for the diff file.' sys.exit(1) -index = re.compile(r'^\+\+\+ b/(.*)') +# The main portion of the script +print '===================================================' +print '%s: starting nn-check' % sys.argv[1] +print '===================================================' + +index = re.compile(r'^\+\+\+ [b/]*([^ \t]*)') plus = re.compile(r'^\+') for line in f: # Check for the "diff --cc " delimiter in order to grab the file name. @@ -104,7 +104,7 @@ for line in f: if index_match: # Store the file name filename=index_match.group(1) - print '--> Checking File: %s' % filename + print '%s: ' % filename else: # Check if the line starts with a "+" character. plus_match = plus.match(line) diff --git a/build/nn-final-symbol-list.txt b/build/nn-final-symbol-list.txt index e2aa87e..5c13bc5 100644 --- a/build/nn-final-symbol-list.txt +++ b/build/nn-final-symbol-list.txt @@ -12,17 +12,17 @@ \blist_add\b \bspin_unlock_irqrestore\b \batomic_t\b -\bup\b +\bup *\(\b \bspin_lock_irqsave\b \bspin_lock_init\b \blist_for_each_entry\b \bwrite_unlock_irqrestore\b \batomic_set\b -\bdown\b +\bdown *\(\b \bhlist_node\b \bHZ\b \batomic_dec\b -\bcompletion\b +\bcompletion *\(\b \blist_for_each_safe\b \bin_interrupt\b \blist_for_each_entry_safe\b @@ -81,7 +81,8 @@ \bunlock_kernel\b \bschedule_timeout\b \brw_semaphore\b -\bmodule\b +\bmodule_init\b +\bmodule_exit\b \bhlist_del_init\b \batomic_inc_return\b \btime_after\b -- 1.8.3.1