]> Git Repo - linux.git/commitdiff
efi: Use the generic efi.memmap instead of 'memmap'
authorMatt Fleming <[email protected]>
Sat, 3 Oct 2015 22:26:07 +0000 (23:26 +0100)
committerIngo Molnar <[email protected]>
Sun, 11 Oct 2015 09:04:18 +0000 (11:04 +0200)
Guenter reports that commit:

  7bf793115dd9 ("efi, x86: Rearrange efi_mem_attributes()")

breaks the IA64 compilation with the following error:

  drivers/built-in.o: In function `efi_mem_attributes': (.text+0xde962): undefined reference to `memmap'

Instead of using the (rather poorly named) global variable
'memmap' which doesn't exist on IA64, use efi.memmap which
points to the 'memmap' object on x86 and arm64 and which is NULL
for IA64.

The fact that efi.memmap is NULL for IA64 is OK because IA64
provides its own implementation of efi_mem_attributes().

Reported-by: Guenter Roeck <[email protected]>
Signed-off-by: Matt Fleming <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Jonathan Zhang <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephen Rothwell <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Tony Luck <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
drivers/firmware/efi/efi.c

index afee2880e0fd527a925f7e0e6eeb02913b6c14fe..16c4928e36af143caccf54f3a4c4c83affb178f0 100644 (file)
@@ -623,13 +623,15 @@ char * __init efi_md_typeattr_format(char *buf, size_t size,
  */
 u64 __weak efi_mem_attributes(unsigned long phys_addr)
 {
+       struct efi_memory_map *map;
        efi_memory_desc_t *md;
        void *p;
 
        if (!efi_enabled(EFI_MEMMAP))
                return 0;
 
-       for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
+       map = efi.memmap;
+       for (p = map->map; p < map->map_end; p += map->desc_size) {
                md = p;
                if ((md->phys_addr <= phys_addr) &&
                    (phys_addr < (md->phys_addr +
This page took 0.060467 seconds and 4 git commands to generate.