1# !/bin/bash 2dir_list="common common_smp common_modules ports ports_module ports_smp samples" 3exclude_list="-path TX" 4file_list=$(find $dir_list \( $exclude_list \) -prune -o -type f -name '*.[ch]' -print) 5cd $(dirname `realpath $0`)/.. 6echo "Checking for unexpected usage of memcpy..." 7echo "" 8echo "Excluding:" 9echo $exclude_list | grep -P "[^\s]*/[^\s]*" -o 10echo "" 11echo "Result:" 12grep -i "memcpy(" -i $file_list -n | grep -i "use case of .* is verified" -v 13if [ "$?" -eq "1" ]; 14then 15 echo "CLEAN" 16 exit 0 17else 18 exit 1 19fi