]> Git Repo - linux.git/commitdiff
efi/bgrt: Use efi_mem_type()
authorJan Beulich <[email protected]>
Fri, 25 Aug 2017 15:50:19 +0000 (16:50 +0100)
committerIngo Molnar <[email protected]>
Sat, 26 Aug 2017 07:20:33 +0000 (09:20 +0200)
Avoid effectively open-coding the function.

Signed-off-by: Jan Beulich <[email protected]>
Signed-off-by: Ard Biesheuvel <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Matt Fleming <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
drivers/firmware/efi/efi-bgrt.c

index b58233e4ed71ac41709318e03ce06c1d1b2c20ce..50793fda78191da4d4889dcabf12744f71411254 100644 (file)
@@ -27,26 +27,6 @@ struct bmp_header {
        u32 size;
 } __packed;
 
-static bool efi_bgrt_addr_valid(u64 addr)
-{
-       efi_memory_desc_t *md;
-
-       for_each_efi_memory_desc(md) {
-               u64 size;
-               u64 end;
-
-               if (md->type != EFI_BOOT_SERVICES_DATA)
-                       continue;
-
-               size = md->num_pages << EFI_PAGE_SHIFT;
-               end = md->phys_addr + size;
-               if (addr >= md->phys_addr && addr < end)
-                       return true;
-       }
-
-       return false;
-}
-
 void __init efi_bgrt_init(struct acpi_table_header *table)
 {
        void *image;
@@ -85,7 +65,7 @@ void __init efi_bgrt_init(struct acpi_table_header *table)
                goto out;
        }
 
-       if (!efi_bgrt_addr_valid(bgrt->image_address)) {
+       if (efi_mem_type(bgrt->image_address) != EFI_BOOT_SERVICES_DATA) {
                pr_notice("Ignoring BGRT: invalid image address\n");
                goto out;
        }
This page took 0.046556 seconds and 4 git commands to generate.