From: Bob Copeland <me@bobcopeland.com>
To: Larry Finger <Larry.Finger@lwfinger.net>
Cc: linux-wireless@vger.kernel.org, linville@tuxdriver.com,
johannes@sipsolutions.net, ath5k-devel@lists.ath5k.org
Subject: Re: [PATCH] ath5k: fix endianness of bitwise ops when installing mic
Date: Tue, 9 Dec 2008 23:54:04 -0500 [thread overview]
Message-ID: <20081210045404.GB11899@hash.localnet> (raw)
In-Reply-To: <493F45C9.6010703@lwfinger.net>
On Tue, Dec 09, 2008 at 10:30:01PM -0600, Larry Finger wrote:
> > key_v[0] = rxmic[0];
> > - key_v[1] = (txmic[0] >> 16) & 0xffff;
> > + key_v[1] = cpu_to_le32(le32_to_cpu(txmic[0]) >> 16);
>
> Is it certain that txmic[0] will not sign extend with the >> 16 operation? Is
> that why you dropped the mask with 0xffff?
Yeah, I added the mask in the first place, but dropped it here because
txmic is an __le32, and as far as I can tell all __le types are also
unsigned, so it shouldn't sign extend.
I'm not a language lawyer though so if anyone knows better, chime in
(I just wrote a simple C program to convince myself).
--
Bob Copeland %% www.bobcopeland.com
prev parent reply other threads:[~2008-12-10 4:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-10 4:05 [PATCH] ath5k: fix endianness of bitwise ops when installing mic Bob Copeland
2008-12-10 4:30 ` Larry Finger
2008-12-10 4:54 ` Bob Copeland [this message]
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=20081210045404.GB11899@hash.localnet \
--to=me@bobcopeland.com \
--cc=Larry.Finger@lwfinger.net \
--cc=ath5k-devel@lists.ath5k.org \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.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 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.