diff options
author | Dou Liyang <douly.fnst@cn.fujitsu.com> | 2017-03-08 06:07:50 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2017-03-13 16:28:38 -0400 |
commit | 5d64d209c4f672e221ea304106b30793f10d95a4 (patch) | |
tree | 6c57dde0f673afd4122bf9fef087756b1f3fc84a | |
parent | 4495c08e84729385774601b5146d51d9e5849f81 (diff) |
x86/apic: Remove the SET_APIC_ID(x) macro
The SET_APIC_ID() macro obfusates the code. Remove it to increase
readability and add a comment to the apic struct to document that the
callback is required on 64-bit.
Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
Link: http://lkml.kernel.org/r/1488971270-14359-1-git-send-email-douly.fnst@cn.fujitsu.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | arch/x86/include/asm/apic.h | 7 | ||||
-rw-r--r-- | arch/x86/kernel/apic/apic.c | 2 |
2 files changed, 2 insertions, 7 deletions
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index 730ef65e8393..bdffcd9eab2b 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h | |||
@@ -252,12 +252,6 @@ static inline int x2apic_enabled(void) { return 0; } | |||
252 | #define x2apic_supported() (0) | 252 | #define x2apic_supported() (0) |
253 | #endif /* !CONFIG_X86_X2APIC */ | 253 | #endif /* !CONFIG_X86_X2APIC */ |
254 | 254 | ||
255 | #ifdef CONFIG_X86_64 | ||
256 | #define SET_APIC_ID(x) (apic->set_apic_id(x)) | ||
257 | #else | ||
258 | |||
259 | #endif | ||
260 | |||
261 | /* | 255 | /* |
262 | * Copyright 2004 James Cleverdon, IBM. | 256 | * Copyright 2004 James Cleverdon, IBM. |
263 | * Subject to the GNU Public License, v.2 | 257 | * Subject to the GNU Public License, v.2 |
@@ -299,6 +293,7 @@ struct apic { | |||
299 | int (*phys_pkg_id)(int cpuid_apic, int index_msb); | 293 | int (*phys_pkg_id)(int cpuid_apic, int index_msb); |
300 | 294 | ||
301 | unsigned int (*get_apic_id)(unsigned long x); | 295 | unsigned int (*get_apic_id)(unsigned long x); |
296 | /* Can't be NULL on 64-bit */ | ||
302 | unsigned long (*set_apic_id)(unsigned int id); | 297 | unsigned long (*set_apic_id)(unsigned int id); |
303 | 298 | ||
304 | int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask, | 299 | int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask, |
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index aee7deddabd0..f3034ba0d043 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c | |||
@@ -2249,7 +2249,7 @@ void __init apic_set_eoi_write(void (*eoi_write)(u32 reg, u32 v)) | |||
2249 | static void __init apic_bsp_up_setup(void) | 2249 | static void __init apic_bsp_up_setup(void) |
2250 | { | 2250 | { |
2251 | #ifdef CONFIG_X86_64 | 2251 | #ifdef CONFIG_X86_64 |
2252 | apic_write(APIC_ID, SET_APIC_ID(boot_cpu_physical_apicid)); | 2252 | apic_write(APIC_ID, apic->set_apic_id(boot_cpu_physical_apicid)); |
2253 | #else | 2253 | #else |
2254 | /* | 2254 | /* |
2255 | * Hack: In case of kdump, after a crash, kernel might be booting | 2255 | * Hack: In case of kdump, after a crash, kernel might be booting |