x86/apic: Drop logical_smp_processor_id() inline
authorDou Liyang <douly.fnst@cn.fujitsu.com>
Thu, 1 Mar 2018 05:59:30 +0000 (13:59 +0800)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 1 Mar 2018 09:12:21 +0000 (10:12 +0100)
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
arch/x86/include/asm/smp.h
arch/x86/kernel/apic/apic.c

index 461f53d27708ae8b80622753122c1a4927537ee2..e2057780d67ff51c3dc03c64f6d83757300a45a6 100644 (file)
@@ -176,16 +176,6 @@ static inline int wbinvd_on_all_cpus(void)
 extern unsigned disabled_cpus;
 
 #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);
 
 #else /* CONFIG_X86_LOCAL_APIC */
index 7a347d7450b65f87fb47bb923fd3ab5c3d10258f..ce20663739221d81d79f4423c97802748de4e2dd 100644 (file)
@@ -1468,7 +1468,7 @@ static void setup_local_APIC(void)
        int cpu = smp_processor_id();
        unsigned int value;
 #ifdef CONFIG_X86_32
-       int i;
+       int logical_apicid, ldr_apicid;
 #endif
 
 
@@ -1507,11 +1507,11 @@ static void setup_local_APIC(void)
         * initialized during get_smp_config(), make sure it matches the
         * actual value.
         */
-       i = early_per_cpu(x86_cpu_to_logical_apicid, cpu);
-       WARN_ON(i != BAD_APICID && i != logical_smp_processor_id());
+       logical_apicid = early_per_cpu(x86_cpu_to_logical_apicid, cpu);
+       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 */
-       early_per_cpu(x86_cpu_to_logical_apicid, cpu) =
-               logical_smp_processor_id();
+       early_per_cpu(x86_cpu_to_logical_apicid, cpu) = ldr_apicid;
 #endif
 
        /*