container_of

Simon Brand simon.brand at postadigitale.de
Mon Jan 19 10:18:22 EST 2015


Am Sat, 17 Jan 2015 22:53:10 +0300
schrieb Mike Krinkin <krinkin.m.u at gmail.com>:

> 
> #define container_of(ptr, type, member) ({ \
> 	(type *)((char *)(ptr) - offsetof(type, member));})
> 

Thank you Mike, this is working!

ptr is not evaluated before the text is replaced -.-
I should know this...

Thank you very much!



More information about the Kernelnewbies mailing list