All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cao jin <caoj.fnst@cn.fujitsu.com>
To: <x86@kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <tglx@linutronix.de>, <mingo@redhat.com>, <bp@alien8.de>,
	<hpa@zytor.com>
Subject: [RFC PATCH] x86/apic: Drop superfluous apic_phys
Date: Fri, 13 Mar 2020 14:37:15 +0800	[thread overview]
Message-ID: <20200313063715.7523-1-caoj.fnst@cn.fujitsu.com> (raw)

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@cn.fujitsu.com>
---
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




             reply	other threads:[~2020-03-13  6:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-13  6:37 Cao jin [this message]
2020-03-13  9:09 ` [RFC PATCH] x86/apic: Drop superfluous apic_phys Cao jin
  -- strict thread matches above, loose matches on Subject: below --
2020-03-12  7:10 Cao jin
2020-03-12  5:38 Cao jin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200313063715.7523-1-caoj.fnst@cn.fujitsu.com \
    --to=caoj.fnst@cn.fujitsu.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.