[PATCH 3/4] ath5k: define ath_common ops

Luis R. Rodriguez lrodriguez at atheros.com
Fri Sep 11 01:46:17 UTC 2009


On Thu, Sep 10, 2009 at 6:42 PM, Bob Copeland <bcopeland at gmail.com> wrote:
> On Thu, Sep 10, 2009 at 9:34 PM, Luis R. Rodriguez
> <lrodriguez at atheros.com> wrote:
>>  static inline u32 ath5k_hw_reg_read(struct ath5k_hw *ah, u16 reg)
>>  {
>> -       return ioread32(ah->ah_iobase + reg);
>> +       return ath5k_hw_common(ah)->ops->read(ah, reg);
>>  }
>
> Is there any way we can do this without two pointer dereferences for every
> read and write?  I have a feeling this is going to make certain operations
> (e.g. loading initvals during reset) really suck.

It seems to work fine on my box, perhaps a single CPU (real single
CPU) user can test to see if there are any differences noted. I don't
think there should be really.

In any case if its deemed too nested for ath5k purposes you can just
leave an ioread/iowrite on the  ath5k_hw_reg_read() and later just
move all read/write ops to use the common ops calls. If someone can
think of better alternatives I'm all ears.

  Luis



More information about the devel mailing list