container_of宏的详细介绍与解答
首先,今天看到代码,接触到这个宏定义,所以有意去研究了一下:struct hid_device *hdev = container_of(dev, struct hid_device, dev);以上面例子来说这个宏的作用为:根据一个结构体变量中的一个域成员变量的指针来获取指向整个结构体变量的指针/*** container_of - cast a member of a stru...
原创
2014-12-22 09:29:08 ·
677 阅读 ·
0 评论