Re: [PATCH] perf/x86/p4: Fix "Wunused-but-set-variable" warning
From: Sean Christopherson
Date: Fri Oct 13 2023 - 12:25:45 EST
On Thu, Oct 12, 2023, Lucy Mielke wrote:
> Am Mon, Oct 09, 2023 at 09:29:50AM -0700 schrieb Sean Christopherson:
> >
> > rdmsr() writes to "high", but nothing ever reads from high. FWIW, I would _love_
> > for rdmsrl() to have return semantics, e.g. to be able to do:
> >
> > low = (u32)rdmsrl(MSR_IA32_MISC_ENABLE);
> >
> > or even
> >
> > if (!(rdmsrl(MSR_IA32_MISC_ENABLE) & BIT(7)))
>
> I have taken a look and it seems to me like this macro is called quite a lot
> for different things thoughout the kernel tree, including drivers. If
> one were to change it to have return semantics instead of the way it
> currently works, you'd have to change around 300 occurences, right?
Yep, which is the only reason I haven't force the issue.