]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
x86/mce/intel: Use MCG_BANKCNT_MASK instead of 0xff
authorQiuxu Zhuo <qiuxu.zhuo@intel.com>
Fri, 25 Oct 2024 02:45:54 +0000 (10:45 +0800)
committerBorislav Petkov (AMD) <bp@alien8.de>
Mon, 28 Oct 2024 13:27:34 +0000 (14:27 +0100)
Use the predefined MCG_BANKCNT_MASK macro instead of the hardcoded
0xff to mask the bank number bits.

No functional changes intended.

Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Reviewed-by: Nikolay Borisov <nik.borisov@suse.com>
Reviewed-by: Sohil Mehta <sohil.mehta@intel.com>
Link: https://lore.kernel.org/r/20241025024602.24318-3-qiuxu.zhuo@intel.com
arch/x86/kernel/cpu/mce/intel.c

index f6103e6bf69a8b7c728afc04f34b4e350a6eaef1..b3cd2c61b11d2263b5128eb5ea2211e5005a9d46 100644 (file)
@@ -94,7 +94,7 @@ static int cmci_supported(int *banks)
        if (!boot_cpu_has(X86_FEATURE_APIC) || lapic_get_maxlvt() < 6)
                return 0;
        rdmsrl(MSR_IA32_MCG_CAP, cap);
-       *banks = min_t(unsigned, MAX_NR_BANKS, cap & 0xff);
+       *banks = min_t(unsigned, MAX_NR_BANKS, cap & MCG_BANKCNT_MASK);
        return !!(cap & MCG_CMCI_P);
 }