Chinaunix首页 | 论坛 | 博客
  • 博客访问: 222730
  • 博文数量: 22
  • 博客积分: 1613
  • 博客等级: 上尉
  • 技术积分: 974
  • 用 户 组: 普通用户
  • 注册时间: 2010-08-19 00:00
个人简介

文章分类

全部博文(22)

文章存档

2013年(1)

2011年(17)

2010年(4)

分类: LINUX

2011-08-21 22:02:34

1. subscribe lkml by sending the following message in plain text to majordomo@vger.kernel.org:
  1. subscribe linux-kernel

2. 
    FAQ: 
    For beginning kernel hackers: 
    Linux Weekly News: 
    insightful commentary on kernel development: 
    内核直通车: 

3. coding style
    Documentation/CodingStyle
    缩进,switch语句,空格,花括号,行的长度,命名规则,注释等等风格
    ...

4. comments
    describe what and why your code is doing, not how it is doing it.
    important notes are often prefixed with "XXX:", and bugs are often prefixed with "FIXME:"
    self-generating documentation: Documentation/kernel-doc-nano-HOWTO.txt
  1. #make htmldocs
  2. #make psdocs

5. i hate typedef as kernel community, yeah!
    never do:
  1. #ifdef CONFIG_FOO
  2. foo();
  3. #endif
    but do:
  1. #ifdef CONFIG_FOO
  2. static int foo(void)
  3. {
  4.     /*..*/
  5. }
  6. #else
  7. static inline int foo(void) {}
  8. #endif /* CONFIG_FOO */

6. structure initializers
  1. struct foo my_foo = {
  2.     .a = INITIAL_A,
  3.     .b = INITIAL_B,
  4. }

7. use indent to format source according to given rules. default is GNU coding style, if wanna follow the linux kernel style:
  1. indent -kr -i8 -ts8 -sob -l80 -ss -bs -ps1
    the script scripts/Lindent automatically invokes indent with the desired options.

8. in the root of the kernel source tree:
CREDITS: kernel hackers with significant contributions
MAINTAINERS: the maintainer for a specific driver or subsystem

9. bug report
REPORTING-BUGS   Documentation/oops-tracing.txt
(1) 很好的描述问题,最好告诉别人如何复现问题
(2) 可以将问题发给对应的maintainer,或者lkml

10. patches
create:
  1. diff -urN linux-x.y.z/ linux/ > my-patch
  2. diff -u linux-x.y.z/some/file linux/some/file > my-patch

git a perfect tool!

  1. patch -p1 < ../my-patch
  2. diffstat -p1 my-patch
submit:
the subject line of the email containing the patch is of the form "[PATCH] brief description", the body of the email describes in technical detail the changes your patch makes and the rationale behind them.



阅读(2196) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~