Re: [PATCH] perf/x86/intel/p4: Fix unused variable warning in p4_pmu_init()
From: Dave Hansen
Date: Thu Mar 19 2026 - 11:39:07 EST
On 3/19/26 08:22, Aldo Conte wrote:
> This patch prints the full content of Model-Specific Register
> via `pr_cont` and so both the low and high part. It is also
> very useful to have the contents of MSR_IA32_MISC_ENABLE
> in dmesg for debugging purposes.
I'd probably just switch it over to rdmsrq():
unsigned int misc;
rdmsr(MSR_IA32_MISC_ENABLE, misc);
if (!(misc & MSR_IA32_MISC_ENABLE_EMON)) {
...
I'm kinda surprised the compiler is complaining, though. I suspect we've
got a ton of these around where one of the registers isn't used.