在ubuntu下,用Visual Studio Code编译自己写的驱动程序,总是出现如下警告:
我的代码如下:
static struct timer_dev{
dev_t devid;
int major;
int minor;
struct cdev cdev;
struct class *class;
struct device *device;
};
struct timer_dev gtimer;
改为:
static struct timer_dev{
dev_t devid;
int major;
int minor;
struct cdev cdev;
struct class *class;
struct device *device;
}gtimer;
//struct timer_dev gtimer;
警告消失!