All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Julian Calaby <julian.calaby@gmail.com>
Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org, tgraf@suug.ch
Subject: Re: [RFC 1/2] genetlink: introduce pre_doit/post_doit hooks
Date: Fri, 01 Oct 2010 00:49:15 +0200	[thread overview]
Message-ID: <1285886955.5137.31.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1285886821.5137.29.camel@jlt3.sipsolutions.net>

On Fri, 2010-10-01 at 00:47 +0200, Johannes Berg wrote:
> On Fri, 2010-10-01 at 00:44 +0200, Johannes Berg wrote:
> > On Fri, 2010-10-01 at 08:41 +1000, Julian Calaby wrote:
> > 
> > > >  d) include two private pointers in each info
> > > >    struct passed between all these operations
> > > >    including doit(). (It's two because I'll
> > > >    need two in nl80211 -- can be extended.)
> > > 
> > > Stupid question:
> > > 
> > > Why not have a priv struct rather than an arbitrary array of two pointers?
> > 
> > It'd have to be dynamically allocated, and the "arbitrary" array of two
> > pointers can be on the stack.
> 
> Maybe I should elaborate -- a priv struct basically means just a single
> pointer, and then I'd have to allocate something to hold two pointers in
> nl80211 and assign it to that single pointer.

Come to think of it -- I could get away with a single pointer, since, if
both are assigned,

user_ptr[0] == wiphy_to_rdev(((netdev *)user_ptr[1])->ieee80211_ptr->wiphy)

but that's a lot of pointy things, and some functions only have the rdev
so it gets more complex. I think allowing two private pointers is a
decent compromise.

johannes


  reply	other threads:[~2010-09-30 22:48 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-30 21:10 [RFC 0/2] generic netlink doit generalisation Johannes Berg
2010-09-30 21:10 ` Johannes Berg
2010-09-30 21:10 ` [RFC 1/2] genetlink: introduce pre_doit/post_doit hooks Johannes Berg
2010-09-30 21:10   ` Johannes Berg
2010-09-30 22:41   ` Julian Calaby
2010-09-30 22:41     ` Julian Calaby
2010-09-30 22:44     ` Johannes Berg
2010-09-30 22:47       ` Johannes Berg
2010-09-30 22:49         ` Johannes Berg [this message]
2010-09-30 22:51           ` Julian Calaby
2010-09-30 22:55             ` Johannes Berg
2010-09-30 22:55               ` Johannes Berg
2010-09-30 23:14               ` Julian Calaby
2010-09-30 23:14                 ` Julian Calaby
2010-09-30 21:10 ` [RFC 2/2] nl80211: use the new genetlink pre/post_doit hooks Johannes Berg
2010-09-30 21:10   ` Johannes Berg
2010-09-30 22:39 ` [RFC 0/2] generic netlink doit generalisation Johannes Berg
2010-09-30 22:39   ` Johannes Berg

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=1285886955.5137.31.camel@jlt3.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=julian.calaby@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tgraf@suug.ch \
    /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.