x86/mce: Remove redundant check from mce_device_create()
authorNikolay Borisov <nik.borisov@suse.com>
Tue, 7 Nov 2023 16:55:29 +0000 (18:55 +0200)
committerBorislav Petkov (AMD) <bp@alien8.de>
Wed, 15 Nov 2023 16:19:14 +0000 (17:19 +0100)
mce_device_create() is called only from mce_cpu_online() which in turn
will be called iff MCA support is available. That is, at the time of
mce_device_create() call it's guaranteed that MCA support is available.
No need to duplicate this check so remove it.

  [ bp: Massage commit message. ]

Signed-off-by: Nikolay Borisov <nik.borisov@suse.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20231107165529.407349-1-nik.borisov@suse.com
arch/x86/kernel/cpu/mce/core.c

index df8d25e744d10c22c98774bb63e540f72feb5a6e..1642018dd6c95bbd504568db1e864ac61154078e 100644 (file)
@@ -2584,9 +2584,6 @@ static int mce_device_create(unsigned int cpu)
        int err;
        int i, j;
 
-       if (!mce_available(&boot_cpu_data))
-               return -EIO;
-
        dev = per_cpu(mce_device, cpu);
        if (dev)
                return 0;