All of lore.kernel.org
 help / color / mirror / Atom feed
From: simon.brand@postadigitale.de (Simon Brand)
To: kernelnewbies@lists.kernelnewbies.org
Subject: container_of
Date: Mon, 19 Jan 2015 16:18:22 +0100	[thread overview]
Message-ID: <20150119161822.7d9767e0@fx> (raw)
In-Reply-To: <20150117195310.GA10787@kmu-tp-x230>

Am Sat, 17 Jan 2015 22:53:10 +0300
schrieb Mike Krinkin <krinkin.m.u@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!

  reply	other threads:[~2015-01-19 15:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-17 16:32 container_of Simon Brand
2015-01-17 16:58 ` container_of Manish Katiyar
2015-01-17 19:45   ` container_of Simon Brand
2015-01-17 19:53     ` container_of Mike Krinkin
2015-01-19 15:18       ` Simon Brand [this message]
2015-01-17 19:13 ` container_of Anish Kumar
  -- strict thread matches above, loose matches on Subject: below --
2008-12-19 17:56 container_of Julia Lawall
2008-12-20 11:54 ` container_of Darren Jenkins
2008-12-20 18:19 ` container_of Julia Lawall
2008-12-23  5:37 ` container_of Greg KH
2008-12-23  6:01 ` container_of Julia Lawall
2008-12-23  6:09 ` container_of Greg KH
2008-12-23  7:00 ` container_of Julia Lawall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150119161822.7d9767e0@fx \
    --to=simon.brand@postadigitale.de \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.