U-Boot Index

1631阅读 0评论2012-03-16 wdove
分类:LINUX


CodeStyle
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/CodingStyle


check tool: 

Time:
Mar.16,2012.

Minutes:
1. Kernel 使用tab缩进,转换成space是不允许的,原因是易读,超过3层缩进需要你重新设计程序。
2. 80列限制:never break user-visible strings such as printk messages, because that breaks the ability to grep for them.
3. Typedefs只有5种情况能用。
4. 函数长度:ISO/ANSI screen size is 80x24,函数长度80x24~80x48, local变量不超过5-10
5. 多行Macro用do...while()完成,有4中Macro的禁忌
6. 不要对超过3行的函数inline
7. 常用的宏:include/linux/kernel.h
8. 函数返回值的定义

上一篇:Linux终端工具guake | Terminal tool - guake
下一篇:sfdisk "trailing junk after number" error