From: Timur Tabi <timur@freescale.com>
To: Mikael Pettersson <mikpe@it.uu.se>
Cc: gregkh@suse.de, linux-kernel@vger.kernel.org
Subject: Re: Add a private_data pointer to struct device_attribute
Date: Sat, 17 Nov 2007 08:02:38 -0600 [thread overview]
Message-ID: <473EF47E.8090402@freescale.com> (raw)
In-Reply-To: <200711170115.lAH1F5kZ009153@harpo.it.uu.se>
Mikael Pettersson wrote:
> A common trick is to embed a generic struct inside a specific one
> containing add-on data fields, and then to map from the generic
> one to the specific one using container_of() in your ops (function
> pointers). This is both faster and less wasteful of memory than
> adding void *private all over the place.
>
> Any reason that won't work here?
Yes, that will work. Sorry, I should have thought of that myself, since I've
used that trick a number of times before.
--
Timur Tabi
Linux Kernel Developer @ Freescale
next prev parent reply other threads:[~2007-11-17 14:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-17 1:15 Add a private_data pointer to struct device_attribute Mikael Pettersson
2007-11-17 14:02 ` Timur Tabi [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-11-17 0:11 Timur Tabi
2007-11-17 1:06 ` Greg KH
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=473EF47E.8090402@freescale.com \
--to=timur@freescale.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mikpe@it.uu.se \
/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