From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
Andi Kleen <ak@linux.intel.com>,
x86@kernel.org
Subject: Re: [PATCH] x86: fix apic.h unused but set warnings v2
Date: Tue, 9 Nov 2010 01:15:29 +0300 [thread overview]
Message-ID: <20101108221528.GH6273@lenovo> (raw)
In-Reply-To: <87oc9zqy0l.fsf@basil.nowhere.org>
On Mon, Nov 08, 2010 at 10:57:30PM +0100, Andi Kleen wrote:
> Thomas Gleixner <tglx@linutronix.de> writes:
>
> > On Mon, 8 Nov 2010, Andi Kleen wrote:
> >> static inline u32 native_apic_msr_read(u32 reg)
> >> {
> >> - u32 low, high;
> >> + u32 low;
> >>
> >> if (reg == APIC_DFR)
> >> return -1;
> >>
> >> - rdmsr(APIC_BASE_MSR + (reg >> 4), low, high);
> >> - return low;
> >> + rdmsrl(APIC_BASE_MSR + (reg >> 4), low);
> >> + return (u32)low;
> >
> > What's the point of casting u32 to u32 ?
>
> One of the earlier reviewers thought adding an explicit cast would make
> the truncation in the code clearer. I didn't full agree either, but
> still did the change.
>
> -Andi
Well, Andi I proposed to define variable as u64 and convert it back to u32 at procedure
exit point. That would be clean, and I still think so ;) Though I'm fine with
either way (I just thought about ones who will be reading this code in future,
and since most the rdmsrl callers already use u64 and unsigned long, this would
be consistent as well).
Cyrill
next prev parent reply other threads:[~2010-11-08 22:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-08 21:20 [PATCH] x86: fix apic.h unused but set warnings v2 Andi Kleen
2010-11-08 21:39 ` Thomas Gleixner
2010-11-08 21:57 ` Andi Kleen
2010-11-08 22:15 ` Cyrill Gorcunov [this message]
2010-11-09 1:50 ` Andi Kleen
2010-11-09 20:22 ` Cyrill Gorcunov
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=20101108221528.GH6273@lenovo \
--to=gorcunov@gmail.com \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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