From: "Randy.Dunlap" <rddunlap@osdl.org>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: linux-kernel@vger.kernel.org, macro@ds2.pg.gda.pl, akpm@digeo.com
Subject: Re: [PATCH] unexpected IO-APIC update
Date: Wed, 25 Jun 2003 08:57:14 -0700 [thread overview]
Message-ID: <20030625085714.3cd7759e.rddunlap@osdl.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0306241825280.1041-100000@home.transmeta.com>
On Tue, 24 Jun 2003 18:31:12 -0700 (PDT) Linus Torvalds <torvalds@transmeta.com> wrote:
|
| On Tue, 24 Jun 2003, Randy.Dunlap wrote:
| >
| > + if (reg_01.version >= 0x20)
| > + *(int *)®_03 = io_apic_read(apic, 3);
|
| There's a lot of these
|
| *(int *)®_03
|
| kinds of things there, and the fact is, gcc's alias analysis doesn't like
| them, _and_ they are ugly.
|
[snippage]
|
| But the ugliness part I care about, and I wonder if it wouldn't be better
| in this case to just make the register definition a "union", and have
| something like
|
| union reg_03 {
| u32 value;
| struct {
| u32 boot_DT:1,
| reserved:31;
| } bits;
| };
|
| and then you can avoid the ugly dereference/cast/address-of thing, and
| just say
|
| reg_03.value
|
| or
|
| reg_03.bits.boot_DT
|
| which looks a lot cleaner.
|
| This is what unions are _designed_ for.
Sure, I'll do that.
--
~Randy
~ http://developer.osdl.org/rddunlap/ ~ http://www.xenotime.net/linux/ ~
next prev parent reply other threads:[~2003-06-25 15:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-24 23:10 Randy.Dunlap
2003-06-25 1:31 ` Linus Torvalds
2003-06-25 15:57 ` Randy.Dunlap [this message]
2003-06-25 16:11 ` Maciej W. Rozycki
2003-06-25 18:23 ` [PATCH] IO-APIC unions Randy.Dunlap
2003-06-26 13:47 ` Maciej W. Rozycki
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=20030625085714.3cd7759e.rddunlap@osdl.org \
--to=rddunlap@osdl.org \
--cc=akpm@digeo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=macro@ds2.pg.gda.pl \
--cc=torvalds@transmeta.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
all inboxes | Powered by JetHome®