IA64 efi: make full use of macro efi_md_size
PATCH 1/1 IA64 efi: 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 Li Zefan <[email protected]>
--- arch/ia64/kernel/efi.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
arch/ia64/kernel/efi.c +5 -5
@@ -369,7 +369,7 @@ efi_get_pal_addr (void)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!" );#if EFI_DEBUG
@@ -377,7 +377,7 @@ efi_get_pal_addr (void)printk (KERN_INFO "CPU %d: mapping PAL code [0x%lx-0x%lx) into [0x%lx-0x%lx)\n" ,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 );#endif return __va (md->phys_addr);
@@ -522,7 +522,7 @@ efi_init (void) md = p;printk ("mem%02u: type=%u, attr=0x%lx, range=[0x%016lx-0x%016lx) (%luMB)\n" , 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 )); } }
@@ -655,7 +655,7 @@ efi_memory_descriptor (unsigned long phys_addr)for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) { 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 NULL ;
@@ -1159,7 +1159,7 @@ efi_initialize_iomem_resources(struct resource *code_resource, res->name = name; 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;if (insert_resource (&iomem_resource, res) <0 )
Signature · 1 line
1.5.3.rc7
Quoted 4 lines · Li Zefan
Macro
efi_md_sizeis defined inefi.c, and here we apply it throughoutefi.c.Signed-off-by Li Zefan <[email protected]>
This looks correct to me.
Acked-by Simon Horman <[email protected]>
Quoted 60 lines
--- arch/ia64/kernel/efi.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)arch/ia64/kernel/efi.c +5
-5@@ -369,7 +369,7 @@ efi_get_pal_addr (void)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!" );#if EFI_DEBUG @@ -377,7 +377,7 @@ efi_get_pal_addr (void)printk (KERN_INFO "CPU %d: mapping PAL code [0x%lx-0x%lx) into [0x%lx-0x%lx)\n" ,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 );#endif return __va (md->phys_addr);@@ -522,7 +522,7 @@ efi_init (void) md = p;printk ("mem%02u: type=%u, attr=0x%lx, range=[0x%016lx-0x%016lx) (%luMB)\n" , 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 )); } }@@ -655,7 +655,7 @@ efi_memory_descriptor (unsigned long phys_addr)for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) { 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 NULL ;@@ -1159,7 +1159,7 @@ efi_initialize_iomem_resources(struct resource *code_resource, res->name = name; 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;if (insert_resource (&iomem_resource, res) <0 )Signature · 6 lines
1.5.3.rc7 - To unsubscribe from this list: send the line "unsubscribe linux-ia64" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 1 line
Horms, California Edition