*new* check_macros: find macro precedence bugs
[smatch.git] / smatch_scripts / gen_no_le16.sh
blob68564e308d0488dcad2b556250308d8e46cbeff4
1 #!/bin/bash
3 file=$1
5 if [[ "$file" = "" ]] ; then
6 echo "Usage: $0 <file with smatch messages>"
7 exit 1
8 fi
10 outfile="kernel.no_le16"
11 bin_dir=$(dirname $0)
12 remove=$(echo ${bin_dir}/../smatch_data/${outfile}.remove)
13 tmp=$(mktemp /tmp/smatch.XXXX)
14 tmp2=$(mktemp /tmp/smatch.XXXX)
16 echo "// list of parameters where you don't need to call cpu_to_le16." > $outfile
17 echo '// generated by `gen_no_le16.sh`' >> $outfile
19 ${bin_dir}/trace_params.pl $file usb_control_msg 4 >> $tmp
20 ${bin_dir}/trace_params.pl $file usb_control_msg 5 >> $tmp
21 ${bin_dir}/trace_params.pl $file usb_control_msg 7 >> $tmp
23 cat $tmp | sort -u > $tmp2
24 mv $tmp2 $tmp
25 cat $tmp $remove $remove 2> /dev/null | sort | uniq -u >> $outfile
26 rm $tmp
27 echo "Done. List saved as '$outfile'"