Re: [PATCH] x86: fix apic.h unused but set warnings

From: Cyrill Gorcunov
Date: Sun Nov 07 2010 - 16:20:55 EST


On Sun, Nov 07, 2010 at 08:53:26PM +0100, Andi Kleen wrote:
...
> diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
> index 286de34..9c4e06b 100644
> --- a/arch/x86/include/asm/apic.h
> +++ b/arch/x86/include/asm/apic.h
> @@ -141,12 +141,12 @@ static inline void native_apic_msr_write(u32 reg, u32 v)
>
> 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);
> + rdmsrl(APIC_BASE_MSR + (reg >> 4), low);
> return low;
> }

At least the former code _didn't_ hide the details of which
part of 'long long' value we need. Would not

u64 val;
rdmsrl(APIC_BASE_MSR + (reg >> 4), val);
return (u32)val;

be more clear?

Cyrill
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/