[RFC PATCH] x86/apic: Drop superfluous apic_phys

From: Cao jin
Date: Fri Mar 13 2020 - 02:42:16 EST


apic_phys seems having totally the same meaning as mp_lapic_addr,
except it is static, replace it.

Signed-off-by: Cao jin <caoj.fnst@xxxxxxxxxxxxxx>
---
Not sure if there is still any corner case, but it boots fine.

arch/x86/kernel/apic/apic.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 5f973fed3c9f..5b7b59951421 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -199,8 +199,6 @@ unsigned int lapic_timer_period = 0;

static void apic_pm_activate(void);

-static unsigned long apic_phys __ro_after_init;
-
/*
* Get the LAPIC version
*/
@@ -1170,7 +1168,7 @@ void clear_local_APIC(void)
u32 v;

/* APIC hasn't been mapped yet */
- if (!x2apic_mode && !apic_phys)
+ if (!x2apic_mode && !mp_lapic_addr)
return;

maxlvt = lapic_get_maxlvt();
@@ -1261,7 +1259,7 @@ void apic_soft_disable(void)
void disable_local_APIC(void)
{
/* APIC hasn't been mapped yet */
- if (!x2apic_mode && !apic_phys)
+ if (!x2apic_mode && !mp_lapic_addr)
return;

apic_soft_disable();
@@ -2111,14 +2109,12 @@ void __init init_apic_mappings(void)
pr_info("APIC: disable apic facility\n");
apic_disable();
} else {
- apic_phys = mp_lapic_addr;
-
/*
* If the system has ACPI MADT tables or MP info, the LAPIC
* address is already registered.
*/
if (!acpi_lapic && !smp_found_config)
- register_lapic_address(apic_phys);
+ register_lapic_address(mp_lapic_addr);
}

/*
@@ -2874,11 +2870,11 @@ early_param("apic", apic_set_verbosity);

static int __init lapic_insert_resource(void)
{
- if (!apic_phys)
+ if (!mp_lapic_addr)
return -1;

/* Put local APIC into the resource map. */
- lapic_resource.start = apic_phys;
+ lapic_resource.start = mp_lapic_addr;
lapic_resource.end = lapic_resource.start + PAGE_SIZE - 1;
insert_resource(&iomem_resource, &lapic_resource);

--
2.21.1