All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] d80211: fix incorrect hw.priv setting in  ieee80211_alloc_hw()
Date: Mon, 19 Feb 2007 08:43:04 -0500	[thread overview]
Message-ID: <1171892584.8550.13.camel@dv> (raw)
In-Reply-To: <1171866799.3471.1.camel@johannes.berg>

On Mon, 2007-02-19 at 07:33 +0100, Johannes Berg wrote:
> On Sun, 2007-02-18 at 16:54 -0500, Pavel Roskin wrote:
> > Oh, and by the way, wouldn't it be reasonable to have an inline function
> > to calculate the pointer to the priv area instead of having an actual
> > field for the pointer?
> 
> Yeah, I guess that isn't too hard to do. But if you think about what the
> current code will compile to that's also just an addition based on the
> struct size that is known at compile time.

Perhaps you misunderstood my idea.  There is an field called priv in
struct ieee80211_hw.  That field will be written to, no matter how good
the compiler is at optimization.  And most drivers will access that
field by reading from memory.

Having an inline function brings following benefits:

1) Memory access is replaced with adding a constant (marginal speed-up)
2) Removing priv from struct ieee80211_hw (marginal memory saving)
3) priv cannot be written to (marginal safety improvement)

I see that the list doesn't look impressive, but I want to correct
possible misunderstanding anyway.

-- 
Regards,
Pavel Roskin


  reply	other threads:[~2007-02-19 13:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-17  7:42 [PATCH] d80211: fix incorrect hw.priv setting in ieee80211_alloc_hw() Pavel Roskin
2007-02-17 10:16 ` Johannes Berg
2007-02-18 21:54   ` Pavel Roskin
2007-02-19  6:33     ` Johannes Berg
2007-02-19 13:43       ` Pavel Roskin [this message]
2007-02-19 14:18         ` 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=1171892584.8550.13.camel@dv \
    --to=proski@gnu.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.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 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.