smatch_data/kernel.unreachable.ignore: add BUG(), WARN_ON() and others
[smatch.git] / smatch_scripts / gen_puts_list.sh
blob5a877aeb8423e1a886bea4610994d8ba6fef5df6
1 #!/bin/bash
3 file=$1
4 project=$(echo "$2" | cut -d = -f 2)
6 if [[ "$file" = "" ]] ; then
7 echo "Usage: $0 <file with smatch messages> -p=<project>"
8 exit 1
9 fi
11 if [[ "$project" != "kernel" ]] ; then
12 exit 0
15 bin_dir=$(dirname $0)
16 remove=$(echo ${bin_dir}/../smatch_data/kernel.puts_argument.remove)
17 tmp=$(mktemp /tmp/smatch.XXXX)
19 echo "// list of functions and the argument they decrement the ref of." > kernel.puts_argument
20 echo '// generated by `gen_puts_list.sh`' >> kernel.puts_argument
21 grep -w puts_arg $file | cut -d ' ' -f 5- >> $tmp
22 cat $tmp $remove $remove 2> /dev/null | sort | uniq -u >> kernel.puts_argument
23 rm $tmp
24 echo "Done. List saved as 'kernel.puts_argument'"