Commit 122134fa authored by Dou Liyang's avatar Dou Liyang Committed by Greg Kroah-Hartman

x86/apic: Drop logical_smp_processor_id() inline

[ Upstream commit 8f156168 ]

The logical_smp_processor_id() inline which is only called in
setup_local_APIC() on x86_32 systems has no real value.

Drop it and directly use GET_APIC_LOGICAL_ID() at the call site and use a
more suitable variable name for readability
Signed-off-by: default avatarDou Liyang <douly.fnst@cn.fujitsu.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Cc: andy.shevchenko@gmail.com
Cc: bhe@redhat.com
Cc: ebiederm@xmission.com
Link: https://lkml.kernel.org/r/20180301055930.2396-4-douly.fnst@cn.fujitsu.comSigned-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 3bbebab1
...@@ -177,16 +177,6 @@ extern int safe_smp_processor_id(void); ...@@ -177,16 +177,6 @@ extern int safe_smp_processor_id(void);
#endif #endif
#ifdef CONFIG_X86_LOCAL_APIC #ifdef CONFIG_X86_LOCAL_APIC
#ifndef CONFIG_X86_64
static inline int logical_smp_processor_id(void)
{
/* we don't want to mark this access volatile - bad code generation */
return GET_APIC_LOGICAL_ID(apic_read(APIC_LDR));
}
#endif
extern int hard_smp_processor_id(void); extern int hard_smp_processor_id(void);
#else /* CONFIG_X86_LOCAL_APIC */ #else /* CONFIG_X86_LOCAL_APIC */
......
...@@ -1342,7 +1342,7 @@ void setup_local_APIC(void) ...@@ -1342,7 +1342,7 @@ void setup_local_APIC(void)
int cpu = smp_processor_id(); int cpu = smp_processor_id();
unsigned int value; unsigned int value;
#ifdef CONFIG_X86_32 #ifdef CONFIG_X86_32
int i; int logical_apicid, ldr_apicid;
#endif #endif
...@@ -1389,11 +1389,11 @@ void setup_local_APIC(void) ...@@ -1389,11 +1389,11 @@ void setup_local_APIC(void)
* initialized during get_smp_config(), make sure it matches the * initialized during get_smp_config(), make sure it matches the
* actual value. * actual value.
*/ */
i = early_per_cpu(x86_cpu_to_logical_apicid, cpu); logical_apicid = early_per_cpu(x86_cpu_to_logical_apicid, cpu);
WARN_ON(i != BAD_APICID && i != logical_smp_processor_id()); ldr_apicid = GET_APIC_LOGICAL_ID(apic_read(APIC_LDR));
WARN_ON(logical_apicid != BAD_APICID && logical_apicid != ldr_apicid);
/* always use the value from LDR */ /* always use the value from LDR */
early_per_cpu(x86_cpu_to_logical_apicid, cpu) = early_per_cpu(x86_cpu_to_logical_apicid, cpu) = ldr_apicid;
logical_smp_processor_id();
#endif #endif
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment