From mboxrd@z Thu Jan 1 00:00:00 1970 From: simon.brand@postadigitale.de (Simon Brand) Date: Mon, 19 Jan 2015 16:18:22 +0100 Subject: container_of In-Reply-To: <20150117195310.GA10787@kmu-tp-x230> References: <20150117173237.69c3e04b@fx> <20150117204506.2c8fd4a3@fx> <20150117195310.GA10787@kmu-tp-x230> Message-ID: <20150119161822.7d9767e0@fx> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org Am Sat, 17 Jan 2015 22:53:10 +0300 schrieb Mike Krinkin : > > #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!