cat typedefs_to_rename | while read TYPEDEF ; do
    from=$(echo $TYPEDEF | cut -f1 -d" ")
    to=$(echo $from | perl -p -i -e 's/(.*)/\L$1\E/g')
    tag=$(echo $TYPEDEF | cut -f2 -d" ")
#    git ls-files drivers/staging/ath6kl | grep "\.[ch]$" | \
#	xargs grep -m1 -c1 -w $to > /dev/null
#    echo "$to: $?"
#    if [[ $? != 0 ]] ; then
#	continue
#    fi
    git ls-files drivers/staging/ath6kl | grep "\.[ch]$" | \
	xargs perl detypedef.perl --from=$from --to=$to --tag=$tag
    cat > commit_msg <<EOF
staging: ath6kl: Convert typedef $from to struct $to 

Remove typedef from struct.
Rename struct.
Rename uses.

EOF
    git commit -s -F commit_msg drivers/staging/ath6kl/
done
