public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Oleg Nesterov <oleg@tv-sign.ru>,
	David Howells <dhowells@redhat.com>
Subject: Re: [PATCH] Add to_delayed_work macro
Date: Tue, 3 Mar 2009 16:46:29 +0100	[thread overview]
Message-ID: <20090303164629.10d80a82@hyperion.delvare> (raw)
In-Reply-To: <49AD4DA0.6040400@s5r6.in-berlin.de>

On Tue, 03 Mar 2009 16:32:48 +0100, Stefan Richter wrote:
> Jean Delvare wrote:
> > On Tue, 3 Mar 2009 00:29:52 -0800, Andrew Morton wrote:
> >> On Tue, 3 Mar 2009 08:34:40 +0100 Jean Delvare <khali@linux-fr.org> wrote:
> >> 
> >> > +#define to_delayed_work(_work)	container_of(_work, struct delayed_work, work)
> >> 
> >> As this is specifically designed to operate on a `struct work*', as
> >> opposed to "any struct which has a field called `work'", we can get
> >> additional type-safety by putting a C interface around it.
> > 
> > This is what I wanted to do in the first place, but then I noticed that
> > _all_ such wrappers around container_of are implemented as macros
> > rather than inline functions.
> 
> /Almost/ all.
> 
> http://lxr.linux.no/linux+v2.6.28/drivers/firewire/fw-device.h#L73

Ah, I missed that one because it's not named to_<something>, sorry.

> > So I decided to follow the crowd. Any idea why it is so?
> 
> Merely old habits.


-- 
Jean Delvare

  reply	other threads:[~2009-03-03 15:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-03  7:34 [PATCH] Add to_delayed_work macro Jean Delvare
2009-03-03  8:29 ` Andrew Morton
2009-03-03  9:22   ` Jean Delvare
2009-03-03 15:32     ` Stefan Richter
2009-03-03 15:46       ` Jean Delvare [this message]
2009-03-03 12:06   ` [PATCH] Add to_delayed_work helper function Jean Delvare
2009-03-03 12:11     ` Ingo Molnar
2009-03-03 13:28       ` Jean Delvare

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=20090303164629.10d80a82@hyperion.delvare \
    --to=khali@linux-fr.org \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@tv-sign.ru \
    --cc=stefanr@s5r6.in-berlin.de \
    /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