b2389fed0a74d15f62a872a742286ff2adf7fb59
7 * container_of - cast a member of a structure out to the containing structure
8 * @ptr: the pointer to the member.
9 * @type: the type of the container struct this is embedded in.
10 * @member: the name of the member within the struct.
13 #define container_of(ptr, type, member) ({ \
14 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
15 (type *)( (char *)__mptr - offsetof(type,member) );})