#define container_of(ptr, type, member) ({ \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,member) );})
return variable whose type is “type” & has member “member”,
the member is pointed by “ptr”
#define list_entry(ptr, type, member) \
container_of(ptr, type, member)
沒有留言:
張貼留言