From 0a855af5a8959e8269854c20c3a316b0156750ed Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Sat, 20 Apr 2013 18:38:26 +0300 Subject: [PATCH] show_unreachable.sh: add some more ignored kernel functions Ignore calls to module_put_and_exit, SEG32 and CASE_PIPExTRE. These are false positives. Signed-off-by: Dan Carpenter --- smatch_scripts/show_unreachable.sh | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/smatch_scripts/show_unreachable.sh b/smatch_scripts/show_unreachable.sh index 5341cd76..7402615d 100755 --- a/smatch_scripts/show_unreachable.sh +++ b/smatch_scripts/show_unreachable.sh @@ -31,6 +31,20 @@ if [[ "$file" = "" ]] ; then exit 1 fi +kernel_ignore_functions="DLM_ASSERT +BT_SI_SM_RETURN +BT_STATE_CHANGE +PARSE_ERROR1 +PARSE_ERROR +CMDINSIZE +PROCESS_SYSTEM_PARAM +RETURN_STATUS +ar9170_regwrite_result +module_put_and_exit +SEG32 +CASE_PIPExTRE +" + grep 'ignoring unreachable' $file | cut -d ' ' -f1 | while read loc; do code_file=$(echo $loc | cut -d ':' -f 1) line=$(echo $loc | cut -d ':' -f 2) @@ -41,9 +55,16 @@ grep 'ignoring unreachable' $file | cut -d ' ' -f1 | while read loc; do egrep -qw '(BUG|BT_STATE_CHANGE)' ; then continue; fi - if tail -n +$(($line)) $code_file | head -n 1 | \ - egrep -qw '(DLM_ASSERT|BT_SI_SM_RETURN|BT_STATE_CHANGE|PARSE_ERROR1|PARSE_ERROR|CMDINSIZE|PROCESS_SYSTEM_PARAM|RETURN_STATUS|ar9170_regwrite_result)' ; then - continue; + skip=0 + line_txt=$(tail -n +$(($line)) $code_file | head -n 1) + for func in $kernel_ignore_functions ; do + if echo "$line_txt" | egrep -qw $func ; then + skip=1 + break + fi + done + if [ "$skip" == 1 ] ; then + continue fi fi -- 2.11.4.GIT