diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2023-08-08 15:04:08 -0700 |
---|---|---|
committer | Dave Hansen <dave.hansen@linux.intel.com> | 2023-08-09 11:58:30 -0700 |
commit | d65eb3195862d600b120b3f6481e016c312158cb (patch) | |
tree | 688991c281a46b8c2b22979e516b4e7c7d414cbd /arch/x86/kernel/apic/probe_64.c | |
parent | 96ae35c75bdd8a327c686cf39030d8ed7f82f558 (diff) | |
download | lwn-d65eb3195862d600b120b3f6481e016c312158cb.tar.gz lwn-d65eb3195862d600b120b3f6481e016c312158cb.zip |
x86/apic/64: Uncopypaste probing
No need for the same thing twice. Also prepares for simplifying the APIC ID
validation checks.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Michael Kelley <mikelley@microsoft.com>
Tested-by: Sohil Mehta <sohil.mehta@intel.com>
Tested-by: Juergen Gross <jgross@suse.com> # Xen PV (dom0 and unpriv. guest)
Diffstat (limited to 'arch/x86/kernel/apic/probe_64.c')
-rw-r--r-- | arch/x86/kernel/apic/probe_64.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/arch/x86/kernel/apic/probe_64.c b/arch/x86/kernel/apic/probe_64.c index 7c9f1a8a83c8..a82bb52d5c69 100644 --- a/arch/x86/kernel/apic/probe_64.c +++ b/arch/x86/kernel/apic/probe_64.c @@ -13,6 +13,15 @@ #include "local.h" +static __init void apic_install_driver(struct apic *driver) +{ + if (apic == driver) + return; + + apic = driver; + pr_info("Switched APIC routing to %s:\n", apic->name); +} + /* Select the appropriate APIC driver */ void __init x86_64_probe_apic(void) { @@ -22,11 +31,7 @@ void __init x86_64_probe_apic(void) for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) { if ((*drv)->probe && (*drv)->probe()) { - if (apic != *drv) { - apic = *drv; - pr_info("Switched APIC routing to %s.\n", - apic->name); - } + apic_install_driver(*drv); break; } } @@ -38,11 +43,7 @@ int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id) for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) { if ((*drv)->acpi_madt_oem_check(oem_id, oem_table_id)) { - if (apic != *drv) { - apic = *drv; - pr_info("Setting APIC routing to %s.\n", - apic->name); - } + apic_install_driver(*drv); return 1; } } |