From: "Luis R. Rodriguez" <lrodriguez@atheros.com>
To: Bob Copeland <me@bobcopeland.com>
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org,
ath9k-devel@lists.ath9k.org, ath5k-devel@lists.ath5k.org
Subject: Re: [PATCH 3/3] ath5k: use bit shift operators for cache line size
Date: Wed, 12 Aug 2009 10:32:35 -0700 [thread overview]
Message-ID: <43e72e890908121032u52ed53f5u5835dd73d83f8871@mail.gmail.com> (raw)
In-Reply-To: <b6c5339f0908121013v4316cfdbsf4e274217555dbe9@mail.gmail.com>
On Wed, Aug 12, 2009 at 10:13 AM, Bob Copeland<me@bobcopeland.com> wrote:
> On Wed, Aug 12, 2009 at 12:57 PM, Luis R.
> Rodriguez<lrodriguez@atheros.com> wrote:
>> This matches ath9k, providing consistency when reading both drivers.
>>
>> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
>> ---
>> drivers/net/wireless/ath/ath5k/base.c | 4 ++--
>> 1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
>> index 63c2b57..2b3cf39 100644
>> --- a/drivers/net/wireless/ath/ath5k/base.c
>> +++ b/drivers/net/wireless/ath/ath5k/base.c
>> @@ -471,7 +471,7 @@ ath5k_pci_probe(struct pci_dev *pdev,
>> * DMA to work so force a reasonable value here if it
>> * comes up zero.
>> */
>> - csz = L1_CACHE_BYTES / sizeof(u32);
>> + csz = L1_CACHE_BYTES >> 2;
>> pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, csz);
>
> I'm not sure it's better,
I did this for consistency between drivers but yes the advantage with
a shift is it should be cheaper than a multiplication. Although I am
not sure if simple multiplications get optimized by either the
compiler or an architecture to shifts.
> although the whole thing seems bogus to
> me. Is there really a modern machine where PCI cache line size should
> only be four bytes?
Beats me, I was just matching the code for ath9k. The whole cache
alignment practice seems to be debatable to me and and hoping Sam
Leffer might recall the exact reasonings behind it.
Whether we remove this though would be a change which should go
through a separate patch I think.
Luis
next prev parent reply other threads:[~2009-08-12 17:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-12 16:56 [PATCH 0/3] ath: advance ath.ko with one more helper Luis R. Rodriguez
2009-08-12 16:56 ` [PATCH 1/3] ath: add common ath_rxbuf_alloc() and make ath9k use it Luis R. Rodriguez
2009-08-12 16:57 ` [PATCH 2/3] ath5k: use common ath.ko ath_rxbuf_alloc() Luis R. Rodriguez
2009-08-12 16:57 ` [PATCH 3/3] ath5k: use bit shift operators for cache line size Luis R. Rodriguez
2009-08-12 17:13 ` Bob Copeland
2009-08-12 17:32 ` Luis R. Rodriguez [this message]
2009-08-12 17:50 ` Bob Copeland
2009-08-12 17:21 ` [PATCH 0/3] ath: advance ath.ko with one more helper Bob Copeland
2009-08-12 17:27 ` [ath5k-devel] " Luis R. Rodriguez
2009-08-13 2:13 ` Nick Kossifidis
2009-08-13 2:59 ` Bob Copeland
2009-08-13 3:07 ` Luis R. Rodriguez
2009-08-13 14:41 ` Nick Kossifidis
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=43e72e890908121032u52ed53f5u5835dd73d83f8871@mail.gmail.com \
--to=lrodriguez@atheros.com \
--cc=ath5k-devel@lists.ath5k.org \
--cc=ath9k-devel@lists.ath9k.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=me@bobcopeland.com \
/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