5 if [ "$1" = "-C" ] ; then
11 if [ "$1" = "-k" ] ; then
16 if [ "$1" = "-b" ] ; then
26 if [[ "$file" = "" ]] ; then
27 echo "Usage: $0 [-C <lines>] [-b] [-k] <file with smatch messages>"
28 echo " -C <lines>: Print <lines> of context"
29 echo " -b : Ignore unreachable break statements"
30 echo " -k : Ignore some kernel defines"
34 kernel_ignore_functions
="DLM_ASSERT
42 ar9170_regwrite_result
48 grep 'ignoring unreachable' $file | cut
-d ' ' -f1 |
while read loc
; do
49 code_file
=$
(echo $loc | cut
-d ':' -f 1)
50 line
=$
(echo $loc | cut
-d ':' -f 2)
52 if [ "$mode" = "kernel" ] ; then
53 # BUG() is sometimes defined away on embedded systems
54 if tail -n +$
(($line - 1)) $code_file |
head -n 1 | \
55 egrep -qw '(BUG|BT_STATE_CHANGE)' ; then
59 line_txt
=$
(tail -n +$
(($line)) $code_file |
head -n 1)
60 for func
in $kernel_ignore_functions ; do
61 if echo "$line_txt" |
egrep -qw $func ; then
66 if [ "$skip" == 1 ] ; then
71 if [ "$nobreak" = "yes" ] ; then
72 if tail -n +$
(($line)) $code_file |
head -n 1 |
grep -qw 'break' ; then
77 echo "========================================================="
79 tail -n +$
(($line - ($context - 1))) $code_file |
head -n $
(($context - 1))
80 echo "---------------------------------------------------------"
81 tail -n +${line} $code_file |
head -n $context