5 if [[ "$file" = "" ]] ; then
6 echo "Usage: $0 <file with smatch messages>"
10 outfile
="kernel.sizeof_param"
12 remove
=$
(echo ${bin_dir}/..
/smatch_data
/${outfile}.remove
)
13 tmp
=$
(mktemp
/tmp
/smatch.XXXX
)
14 tmp2
=$
(mktemp
/tmp
/smatch.XXXX
)
17 echo "// list of function parameters that are the size of a buffer." > $outfile
18 echo '// generated by `gen_sizeof_param.sh`' >> $outfile
20 cat $file |
grep sizeof_param |
grep '[0-9] [0-9]$' | cut
-d ' ' -f 5- | \
21 sort -u |
sed -e "s/'//g" > $tmp
22 grep -f $remove $tmp >> $tmp2
23 cat $tmp $tmp2 2> /dev
/null |
sort |
uniq -u >> $outfile
27 echo "Done. List saved as '$outfile'"