2条命令搞定,最后一条命令用于检测,如果有error或者warning 根据提示再做微调。
$astyle --style=linux -z2 /path/filename
$indent -npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cp1 /path/filename
$./scripts/checkpatch.pl -f /path/filename
详细的编码风格,请参考如下:
http://iyu.is-programmer.com/posts/30315.html