4 project
=$
(echo "$2" | cut
-d = -f 2)
6 if [[ "$file" = "" ]] ; then
7 echo "Usage: $0 <file with smatch messages> -p=<project>"
11 if [[ "$project" != "kernel" ]] ; then
15 outfile
="kernel.expects_err_ptr"
17 remove
=$
(echo ${bin_dir}/..
/smatch_data
/${outfile}.remove
)
18 tmp
=$
(mktemp
/tmp
/smatch.XXXX
)
20 echo "// list of functions which expect an ERR_PTR." > $outfile
21 echo '// generated by `gen_expects_err_ptr.sh`' >> $outfile
22 grep -w "expects ERR_PTR" $file | cut
-d ' ' -f 2,6 | \
23 sed -e 's/([1234567890]*)//' |
sort -u > $tmp
24 cat $tmp $remove $remove 2> /dev
/null |
sort |
uniq -u >> $outfile
26 echo "Done. List saved as '$outfile'"