mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mikael Pettersson <mikpe@csd.uu.se>
To: kevin@koconnor.net, neilb@cse.unsw.edu.au
Cc: linux-kernel@vger.kernel.org, torvalds@transmeta.com
Subject: Re: PATCH: type safe(r) list_entry repacement: generic_out_cast
Date: Wed, 24 Jul 2002 02:51:58 +0200 (MET DST)	[thread overview]
Message-ID: <200207240051.CAA16434@harpo.it.uu.se> (raw)

On Tue, 23 Jul 2002 18:58:52 -0400, Kevin O'Connor wrote:
>#define BackPtr(ptr, type, member) ({                                         \
>        typeof( ((type *)0)->member ) *__mptr = (ptr);                        \
>        ((type *)( (char *)__mptr - (unsigned long)(&((type *)0)->member) ));})

I've seen this sort of code several times now in the Linux kernel,
and I've never liked it. Is there some reason why you guys avoid
offsetof() like the plague?

/Mikael

             reply	other threads:[~2002-07-24  0:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-24  0:51 Mikael Pettersson [this message]
2002-07-24  1:04 ` Linus Torvalds
  -- strict thread matches above, loose matches on Subject: below --
2002-07-23 11:28 Neil Brown
2002-07-23 11:47 ` Jakob Oestergaard
2002-07-23 12:42 ` Brian Gerst
2002-07-23 16:29 ` Linus Torvalds
2002-07-24  5:25   ` Thunder from the hill
2002-07-23 16:36 ` Christoph Hellwig
2002-07-23 22:58 ` Kevin O'Connor

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=200207240051.CAA16434@harpo.it.uu.se \
    --to=mikpe@csd.uu.se \
    --cc=kevin@koconnor.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@cse.unsw.edu.au \
    --cc=torvalds@transmeta.com \
    /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

all inboxes | Powered by JetHome®