Linux驱动开发中常见的几个很差的习惯

1)声明结构体时忘记struct 关键字指针 内核并无使用诸如typedef struct list_head list_head这样的方法,因此在声明结构数据类型时不要忘记struct 关键字数据类型 struct list_head list1;方法 2)使用printk打印指针类型数据忘记判断指针是否为NULL,致使内核崩溃或启动过程终止数据
相关文章
相关标签/搜索