Commit ce65cade authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Arrange for EFI-related code to be compiled away

From: David Mosberger <davidm@napali.hpl.hp.com>

There is some EFI-related code which is present in the ia64 build but is not
needed: variable efi_enabled is always zero.

The patch fiddles with the efi_enabled definition to arrange for
`efi_enabled' to be constant zero or constant one in those situations where
this can be guaranteed.
parent d91341a9
...@@ -55,10 +55,6 @@ ...@@ -55,10 +55,6 @@
# error "struct cpuinfo_ia64 too big!" # error "struct cpuinfo_ia64 too big!"
#endif #endif
#ifdef CONFIG_EFI
int efi_enabled = 1;
#endif
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
unsigned long __per_cpu_offset[NR_CPUS]; unsigned long __per_cpu_offset[NR_CPUS];
EXPORT_SYMBOL(__per_cpu_offset); EXPORT_SYMBOL(__per_cpu_offset);
......
...@@ -301,10 +301,18 @@ extern inline unsigned long __init efi_get_time(void); ...@@ -301,10 +301,18 @@ extern inline unsigned long __init efi_get_time(void);
extern inline int __init efi_set_rtc_mmss(unsigned long nowtime); extern inline int __init efi_set_rtc_mmss(unsigned long nowtime);
extern struct efi_memory_map memmap; extern struct efi_memory_map memmap;
/*
* We play games with efi_enabled so that the compiler will, if possible, remove
* EFI-related code altogether.
*/
#ifdef CONFIG_EFI #ifdef CONFIG_EFI
extern int efi_enabled; # ifdef CONFIG_X86
extern int efi_enabled;
# else
# define efi_enabled 1
# endif
#else #else
#define efi_enabled 0 # define efi_enabled 0
#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