Thursday, November 07, 2013

container_of

#first give me member variable you have (whose parent structure is wanted)
#second give me prototype of parent structure
#third give me the exact name of the #first one inside the #second one
 
* container_of - cast a member of a structure out to the containing structure
* @ptr:    the pointer to the member.
* @type:   the type of the container struct this is embedded in.
* @member: the name of the member within the struct.
 

No comments: