调试input 设备某sensor时候遇到一个有关container_of 报出 warning: initialization from incompatible pointer type 的警告。
这一切都是struct delayed_work work;惹的祸!
解决办法:
将
struct pcap_ts *pcap_ts = container_of(work, struct pcap_ts, work);
修改成
struct delayed_work *dw = container_of(work, struct delayed_work, work);
struct pcap_ts *pcap_ts = container_of(dw, struct pcap_ts, work);
或者
struct pcap_ts *pcap_ts = container_of(work, struct pcap_ts, work.work);