aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDou Liyang <douly.fnst@cn.fujitsu.com>2018-03-01 00:59:30 -0500
committerThomas Gleixner <tglx@linutronix.de>2018-03-01 04:12:21 -0500
commit8f1561680f42a5491b371b513f1ab8197f31fd62 (patch)
tree079eea652579a4b2892bddbc09c9d0e8cd879b25
parent3ea9e7ae1a2038b9fdff729861c9b4af0087024f (diff)
x86/apic: Drop logical_smp_processor_id() inline
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: Dou Liyang <douly.fnst@cn.fujitsu.com> Signed-off-by: Thomas 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.com
-rw-r--r--arch/x86/include/asm/smp.h10
-rw-r--r--arch/x86/kernel/apic/apic.c10
2 files changed, 5 insertions, 15 deletions
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
index 461f53d27708..e2057780d67f 100644
--- a/arch/x86/include/asm/smp.h
+++ b/arch/x86/include/asm/smp.h
@@ -176,16 +176,6 @@ static inline int wbinvd_on_all_cpus(void)
176extern unsigned disabled_cpus; 176extern unsigned disabled_cpus;
177 177
178#ifdef CONFIG_X86_LOCAL_APIC 178#ifdef CONFIG_X86_LOCAL_APIC
179
180#ifndef CONFIG_X86_64
181static inline int logical_smp_processor_id(void)
182{
183 /* we don't want to mark this access volatile - bad code generation */
184 return GET_APIC_LOGICAL_ID(apic_read(APIC_LDR));
185}
186
187#endif
188
189extern int hard_smp_processor_id(void); 179extern int hard_smp_processor_id(void);
190 180
191#else /* CONFIG_X86_LOCAL_APIC */ 181#else /* CONFIG_X86_LOCAL_APIC */
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 7a347d7450b6..ce2066373922 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1468,7 +1468,7 @@ static void setup_local_APIC(void)
1468 int cpu = smp_processor_id(); 1468 int cpu = smp_processor_id();
1469 unsigned int value; 1469 unsigned int value;
1470#ifdef CONFIG_X86_32 1470#ifdef CONFIG_X86_32
1471 int i; 1471 int logical_apicid, ldr_apicid;
1472#endif 1472#endif
1473 1473
1474 1474
@@ -1507,11 +1507,11 @@ static void setup_local_APIC(void)
1507 * initialized during get_smp_config(), make sure it matches the 1507 * initialized during get_smp_config(), make sure it matches the
1508 * actual value. 1508 * actual value.
1509 */ 1509 */
1510 i = early_per_cpu(x86_cpu_to_logical_apicid, cpu); 1510 logical_apicid = early_per_cpu(x86_cpu_to_logical_apicid, cpu);
1511 WARN_ON(i != BAD_APICID && i != logical_smp_processor_id()); 1511 ldr_apicid = GET_APIC_LOGICAL_ID(apic_read(APIC_LDR));
1512 WARN_ON(logical_apicid != BAD_APICID && logical_apicid != ldr_apicid);
1512 /* always use the value from LDR */ 1513 /* always use the value from LDR */
1513 early_per_cpu(x86_cpu_to_logical_apicid, cpu) = 1514 early_per_cpu(x86_cpu_to_logical_apicid, cpu) = ldr_apicid;
1514 logical_smp_processor_id();
1515#endif 1515#endif
1516 1516
1517 /* 1517 /*