compat: check if efi_enabled() was already backported
authorHauke Mehrtens <hauke@hauke-m.de>
Sun, 10 Feb 2013 20:50:15 +0000 (21:50 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 10 Feb 2013 20:55:34 +0000 (21:55 +0100)
efi_enabled() gets backported to older kernel versions and if this is
the case compat should not try to do the same.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
include/linux/compat-3.8.h

index b55a46d91e9da89ac65c719f03ffe16ef05f1751..c913188ae69729ff42894d518ef3e54ee4b02b20 100644 (file)
@@ -58,6 +58,8 @@ static inline int __must_check kref_get_unless_zero(struct kref *kref)
  *     efi: Make 'efi_enabled' a function to query EFI facilities
  *
  */
+/* check first if this was already backported */
+#ifndef EFI_BOOT
 /*
  * We play games with efi_enabled so that the compiler will, if
  * possible, remove EFI-related code altogether.
@@ -101,6 +103,7 @@ static inline int compat_efi_enabled(int facility)
 #undef efi_enabled
 #endif
 #define efi_enabled(facility) compat_efi_enabled(facility)
+#endif /* EFI_BOOT */
 
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)) */