Re: [PATCH 02/32] powercap: Stop using 32-bit MSR interfaces

From: Ingo Molnar

Date: Mon Jun 29 2026 - 08:37:29 EST



* Jürgen Groß <jgross@xxxxxxxx> wrote:

> On 29.06.26 13:25, Ingo Molnar wrote:
> >
> > * Juergen Gross <jgross@xxxxxxxx> wrote:
> >
> > > The 32-bit MSR interfaces rdmsr_safe() and wrmsr_safe() are planned to
> > > be removed. Use the related 64-bit variants instead.
> > >
> > > Drop a pointless initializer.
> >
> > Was the initializer really 'pointless'? IIRC it suppressed a build warning
> > on 32-bit builds, at least in some past iterations of these APIs.
>
> I don't see the connection to 32-bit builds. Either the uninitialized
> variable is a problem or not. And I don't see why "l" didn't need an initial
> value (it is modified in this function only via a "&=" operation, so some
> bits would still be random in case it is seen not to be set by rdmsr_safe()).
>
> In reality it should never be a problem, as rdmsr_safe() will always set both
> output variables to a value (0 in case of error, MSR contents else).

So it's not rdmsr_safe() but rdmsr(), but we had this:

10a5d65856b9 ("x86/process: Convert rdmsr() to rdmsrq() in arch_post_acpi_subsys_init() to address W=1 warning")

Which addressed this W=1 warning:

arch/x86/kernel/process.c: In function 'arch_post_acpi_subsys_init':
arch/x86/kernel/process.c:972:17: warning: variable 'hi' set but not used

By the pattern the 'pointless' hi=0 initialization looks similar
and may not be as pointless as it seems. :-)

Thanks,

Ingo