Convert Windows EOL to Unix one using 'dos2unix' tool
Fix misspellings using codespell tool
Remove trailing whitespaces

I use following command

find -name \*.c -or -name \*.h | xargs sed -ibak 's/\s*$//g'
Replace leading spaces with tabs

while true; do find -name \*.c -or -name \*.h | xargs sed -ibak 's/^\(\t*\)  /\1\t/g'; done
Indent the code using GNU indent tool

find -name \*.c -or -name \*.h | xargs indent -nbad -bap -nbc -bbo -hnl -br -brs -c33 -cd33 -ncdb -ce -ci4 -cli0 -d0 -di1 -nfc1 -i8 -ip0 -l120 -lp -npcs -nprs -npsl -sai -saf -saw -ncs -nsc -sob -nfca -cp33 -ss -ts8 -il1

The keys to indent tool correspond to Linux code style. See the manual that gives this set.