Search Linux Wireless

Re: [PATCH] d80211: fix incorrect hw.priv setting in ieee80211_alloc_hw()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux