I am trying to understand some proprietary code in which container_of is called with single parameter which is a member struct of the return struct.
struct want{
.
.
struct member_used;
};
member_struct *ptr_member_used;
struct want *ret_struct container_of(ptr_member_used);
i checked following links
http://codinghighway.com/2013/08/10/the-magical-container-of-macro-and-its-use-in-the-linux-kernel/
Doubts regarding container_of macro in linux
Understanding container_of macro in the Linux kernel
When do you use container_of macro?
but all these links are using three parameters but none of them is using struct member to retrieve corresponding struct.
My worry here is how container_of macro returns corresponding struct just by passing struct member?
program is running correctly on 64 bit ubuntu 14.0.4 with kernel 3.13.0 and gcc 4.8.4