From: Michael Buesch <mb@bu3sch.de>
To: Larry Finger <Larry.Finger@lwfinger.net>
Cc: John W Linville <linville@tuxdriver.com>,
chunkeey@web.de, linux-wireless@vger.kernel.org
Subject: Re: [RFC/RFT] p54: Fix sparse warnings
Date: Sat, 13 Sep 2008 14:40:01 +0200 [thread overview]
Message-ID: <200809131440.01505.mb@bu3sch.de> (raw)
In-Reply-To: <48CABA84.2060404@lwfinger.net>
On Friday 12 September 2008 20:52:52 Larry Finger wrote:
> Michael Buesch wrote:
> > On Friday 12 September 2008 20:16:03 Larry Finger wrote:
> >> struct bootrec {
> >> __le32 code;
> >> __le32 len;
> >> - u32 data[0];
> >> + /* Most references to the data section that follows are for u32
> >> + * quantities; however, one is for an le16 quantity. The union
> >> + * below avoids a cast and makes the usage clearer. */
> >> + union {
> >> + u32 data[0];
> >> + __le16 data16[0];
> >> + };
> >> } __attribute__((packed));
> >
> > I suggest you change
> > u32 data[0];
> > to
> > __le32 data_le32[0];
> > and also add
> > __be32 data_be32[0];
> > to the union. This avoids another few casts.
> > (Maybe you don't even need the __le32 variant. I didn't check all the code).
>
> No, it won't avoid any casts. The program uses the data area 7 times
> in native-cpu order, once as be32, and once in little-endian order
Is the native use correct? Smells fishy.
--
Greetings Michael.
next prev parent reply other threads:[~2008-09-13 12:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-12 18:16 [RFC/RFT] p54: Fix sparse warnings Larry Finger
2008-09-12 18:36 ` Michael Buesch
2008-09-12 18:39 ` Michael Buesch
2008-09-12 18:52 ` Larry Finger
2008-09-13 12:40 ` Michael Buesch [this message]
2008-09-13 15:40 ` Larry Finger
2008-09-17 16:15 ` Pavel Roskin
2008-09-17 17:16 ` Larry Finger
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=200809131440.01505.mb@bu3sch.de \
--to=mb@bu3sch.de \
--cc=Larry.Finger@lwfinger.net \
--cc=chunkeey@web.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).