5 if [[ "$file" = "" ]] ; then
6 echo "Usage: $0 <file with smatch messages>"
11 remove
=$
(echo ${bin_dir}/..
/smatch_data
/kernel.allocation_funcs.remove
)
12 tmp
=$
(mktemp
/tmp
/smatch.XXXX
)
14 echo "// list of functions that return a new allocation." \
15 > kernel.allocation_funcs
16 echo '// generated by `gen_allocation_list.sh`' >> kernel.allocation_funcs
17 grep "allocation func$" $file | cut
-s -d ' ' -f 3 | cut
-d '(' -f 1 | \
19 echo "kmalloc" >> $tmp
20 echo "kzalloc" >> $tmp
21 echo "kcalloc" >> $tmp
22 cat $tmp $remove $remove 2> /dev
/null |
sort |
uniq -u \
23 >> kernel.allocation_funcs
25 echo "Done. List saved as 'kernel.allocation_funcs'"