arm64/efi: invert UEFI memory region reservation logic
[sfrench/cifs-2.6.git] / arch / arm64 / kernel / efi.c
index 95c49ebc660dd85864981bfdfa13bc1f5066d76f..2e829148fb36ad74a6ea4d33f88535869975b43f 100644 (file)
@@ -125,17 +125,17 @@ out:
  */
 static __init int is_reserve_region(efi_memory_desc_t *md)
 {
-       if (!is_normal_ram(md))
+       switch (md->type) {
+       case EFI_LOADER_CODE:
+       case EFI_LOADER_DATA:
+       case EFI_BOOT_SERVICES_CODE:
+       case EFI_BOOT_SERVICES_DATA:
+       case EFI_CONVENTIONAL_MEMORY:
                return 0;
-
-       if (md->attribute & EFI_MEMORY_RUNTIME)
-               return 1;
-
-       if (md->type == EFI_ACPI_RECLAIM_MEMORY ||
-           md->type == EFI_RESERVED_TYPE)
-               return 1;
-
-       return 0;
+       default:
+               break;
+       }
+       return is_normal_ram(md);
 }
 
 static __init void reserve_regions(void)