1)声明结构体时忘记struct 关键字
内核并没有使用诸如typedef struct list_head list_head这样的方法,所以在声明结构数据类型时不要忘记struct 关键字
struct list_head list1;
2)使用printk打印指针类型数据忘记判断指针是否为NULL,导致内核崩溃或启动过程终止
1)声明结构体时忘记struct 关键字
内核并没有使用诸如typedef struct list_head list_head这样的方法,所以在声明结构数据类型时不要忘记struct 关键字
struct list_head list1;
2)使用printk打印指针类型数据忘记判断指针是否为NULL,导致内核崩溃或启动过程终止