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

There is some EFI-related code whcih 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.



---

 25-akpm/arch/ia64/kernel/setup.c |    4 ----
 25-akpm/include/linux/efi.h      |   12 ++++++++++--
 2 files changed, 10 insertions(+), 6 deletions(-)

diff -puN arch/ia64/kernel/setup.c~efi-conditional-cleanup arch/ia64/kernel/setup.c
--- 25/arch/ia64/kernel/setup.c~efi-conditional-cleanup	Mon Jan 12 16:11:20 2004
+++ 25-akpm/arch/ia64/kernel/setup.c	Mon Jan 12 16:11:20 2004
@@ -54,10 +54,6 @@
 # error "struct cpuinfo_ia64 too big!"
 #endif
 
-#ifdef CONFIG_EFI
-int efi_enabled = 1;
-#endif
-
 #ifdef CONFIG_SMP
 unsigned long __per_cpu_offset[NR_CPUS];
 #endif
diff -puN include/linux/efi.h~efi-conditional-cleanup include/linux/efi.h
--- 25/include/linux/efi.h~efi-conditional-cleanup	Mon Jan 12 16:11:20 2004
+++ 25-akpm/include/linux/efi.h	Mon Jan 12 16:11:20 2004
@@ -301,10 +301,18 @@ extern inline unsigned long __init efi_g
 extern inline int __init efi_set_rtc_mmss(unsigned long nowtime);
 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
-extern int efi_enabled;
+# ifdef CONFIG_X86
+   extern int efi_enabled;
+# else
+#  define efi_enabled 1
+# endif
 #else
-#define efi_enabled 0
+# define efi_enabled 0
 #endif
 
 /*

_