kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: krinkin.m.u@gmail.com (Mike Krinkin)
To: kernelnewbies@lists.kernelnewbies.org
Subject: container_of
Date: Sat, 17 Jan 2015 22:53:10 +0300	[thread overview]
Message-ID: <20150117195310.GA10787@kmu-tp-x230> (raw)
In-Reply-To: <20150117204506.2c8fd4a3@fx>

Hi, Simon

> I compiled the kernel two times, one time with the original code and
> one time with
> #define container_of(ptr, type, member) ({			\
> 	(type *)( (char *)ptr - offsetof(type,member) );})

try with following version:

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

  reply	other threads:[~2015-01-17 19:53 UTC|newest]

Thread overview: 6+ 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     ` Mike Krinkin [this message]
2015-01-19 15:18       ` container_of Simon Brand
2015-01-17 19:13 ` container_of Anish Kumar

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=20150117195310.GA10787@kmu-tp-x230 \
    --to=krinkin.m.u@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).