kernel_user_data: don't set *my_struct to user data
[smatch.git] / smatch_scripts / add_gfp_to_allocations.sh
blob090150838d548a9541b3ebfc1cba46e1d3cafd22
1 #!/bin/bash
3 if ! test -e kernel.allocation_funcs || ! test -e kernel.gfp_flags ; then
4 echo "We need the kernel.allocation_funcs and the kernel.gfp_flags files"
5 echo "The scripts to generate them are in smatch_data/"
6 exit 1
7 fi
9 bin_dir=$(dirname $0)
10 remove=$(echo ${bin_dir}/../smatch_data/kernel.allocation_funcs_gfp.remove)
11 tmp=$(mktemp /tmp/smatch.XXXX)
13 echo "// Automatically generated by add_gfp_to_allocations.sh" > kernel.allocation_funcs_gfp
14 for i in $(grep -v "//" kernel.allocation_funcs) ; do
15 if ! grep -w $i kernel.gfp_flags ; then
16 echo $i X
18 done >> $tmp
20 cat $tmp $remove $remove 2> /dev/null | sort | uniq -u >> kernel.allocation_funcs_gfp
21 rm $tmp
23 echo "Done. Created kernel.allocation_funcs_gfp"