Commit 685c7f5d authored by Li Zefan's avatar Li Zefan Committed by Tony Luck

[IA64] make full use of macro efi_md_size

Macro efi_md_size is defined in efi.c, and here we apply it throughout
efi.c.
Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
Acked-by: default avatarSimon Horman <horms@verge.net.au>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent b898a424
...@@ -370,7 +370,7 @@ efi_get_pal_addr (void) ...@@ -370,7 +370,7 @@ efi_get_pal_addr (void)
continue; continue;
} }
if (md->num_pages << EFI_PAGE_SHIFT > IA64_GRANULE_SIZE) if (efi_md_size(md) > IA64_GRANULE_SIZE)
panic("Woah! PAL code size bigger than a granule!"); panic("Woah! PAL code size bigger than a granule!");
#if EFI_DEBUG #if EFI_DEBUG
...@@ -378,7 +378,7 @@ efi_get_pal_addr (void) ...@@ -378,7 +378,7 @@ efi_get_pal_addr (void)
printk(KERN_INFO "CPU %d: mapping PAL code [0x%lx-0x%lx) into [0x%lx-0x%lx)\n", printk(KERN_INFO "CPU %d: mapping PAL code [0x%lx-0x%lx) into [0x%lx-0x%lx)\n",
smp_processor_id(), md->phys_addr, smp_processor_id(), md->phys_addr,
md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT), md->phys_addr + efi_md_size(md),
vaddr & mask, (vaddr & mask) + IA64_GRANULE_SIZE); vaddr & mask, (vaddr & mask) + IA64_GRANULE_SIZE);
#endif #endif
return __va(md->phys_addr); return __va(md->phys_addr);
...@@ -523,7 +523,7 @@ efi_init (void) ...@@ -523,7 +523,7 @@ efi_init (void)
md = p; md = p;
printk("mem%02u: type=%u, attr=0x%lx, range=[0x%016lx-0x%016lx) (%luMB)\n", printk("mem%02u: type=%u, attr=0x%lx, range=[0x%016lx-0x%016lx) (%luMB)\n",
i, md->type, md->attribute, md->phys_addr, i, md->type, md->attribute, md->phys_addr,
md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT), md->phys_addr + efi_md_size(md),
md->num_pages >> (20 - EFI_PAGE_SHIFT)); md->num_pages >> (20 - EFI_PAGE_SHIFT));
} }
} }
...@@ -656,7 +656,7 @@ efi_memory_descriptor (unsigned long phys_addr) ...@@ -656,7 +656,7 @@ efi_memory_descriptor (unsigned long phys_addr)
for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) { for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) {
md = p; md = p;
if (phys_addr - md->phys_addr < (md->num_pages << EFI_PAGE_SHIFT)) if (phys_addr - md->phys_addr < efi_md_size(md))
return md; return md;
} }
return NULL; return NULL;
...@@ -1158,7 +1158,7 @@ efi_initialize_iomem_resources(struct resource *code_resource, ...@@ -1158,7 +1158,7 @@ efi_initialize_iomem_resources(struct resource *code_resource,
res->name = name; res->name = name;
res->start = md->phys_addr; res->start = md->phys_addr;
res->end = md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT) - 1; res->end = md->phys_addr + efi_md_size(md) - 1;
res->flags = flags; res->flags = flags;
if (insert_resource(&iomem_resource, res) < 0) if (insert_resource(&iomem_resource, res) < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment