Skip to content

Commit

Permalink
x86/apic: Make x2apic_mode depend on CONFIG_X86_X2APIC
Browse files Browse the repository at this point in the history
No point in having a static variable around which is always 0. Let the
compiler optimize code out if disabled.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Borislav Petkov <bp@alien8.de>
Cc: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Tony Luck <tony.luck@intel.com>
Link: http://lkml.kernel.org/r/20150115211702.363274310@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
KAGA-KOKO committed Jan 22, 2015
1 parent 8d80696 commit 81a46dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions arch/x86/include/asm/apic.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ extern u32 native_safe_apic_wait_icr_idle(void);
extern void native_apic_icr_write(u32 low, u32 id);
extern u64 native_apic_icr_read(void);

extern int x2apic_mode;

static inline bool apic_is_x2apic_enabled(void)
{
u64 msr;
Expand Down Expand Up @@ -178,6 +176,7 @@ static inline u64 native_x2apic_icr_read(void)
return val;
}

extern int x2apic_mode;
extern int x2apic_phys;
extern int x2apic_preenabled;
extern void check_x2apic(void);
Expand Down Expand Up @@ -210,8 +209,9 @@ static inline void x2apic_force_phys(void)
{
}

#define x2apic_preenabled 0
#define x2apic_supported() 0
#define x2apic_mode (0)
#define x2apic_preenabled (0)
#define x2apic_supported() (0)
#endif

extern void enable_IR_x2apic(void);
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kernel/apic/apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ static __init int setup_apicpmtimer(char *s)
__setup("apicpmtimer", setup_apicpmtimer);
#endif

int x2apic_mode;
#ifdef CONFIG_X86_X2APIC
int x2apic_mode;
/* x2apic enabled before OS handover */
int x2apic_preenabled;
static int x2apic_disabled;
Expand Down

0 comments on commit 81a46dd

Please sign in to comment.