[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] xen/arm: efi: Rework acpi_create_efi_mmap_table to avoid memory_map[offset]
commit 792aba23a5cc6f87e8ba8f18799f522e33815bf1 Author: Julien Grall <julien.grall@xxxxxxx> AuthorDate: Wed Mar 8 17:54:35 2017 +0000 Commit: Stefano Stabellini <sstabellini@xxxxxxxxxx> CommitDate: Wed Mar 8 10:24:01 2017 -0800 xen/arm: efi: Rework acpi_create_efi_mmap_table to avoid memory_map[offset] The code contains a lot of memory_map[offset]. This could be simplified by incrementing the descriptor pointer every time. Signed-off-by: Julien Grall <julien.grall@xxxxxxx> Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx> --- xen/arch/arm/efi/efi-dom0.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/xen/arch/arm/efi/efi-dom0.c b/xen/arch/arm/efi/efi-dom0.c index f307f26..f0ceaa6 100644 --- a/xen/arch/arm/efi/efi-dom0.c +++ b/xen/arch/arm/efi/efi-dom0.c @@ -112,25 +112,24 @@ void __init acpi_create_efi_mmap_table(struct domain *d, const struct meminfo *mem, struct membank tbl_add[]) { - EFI_MEMORY_DESCRIPTOR *memory_map; - unsigned int i, offset; + EFI_MEMORY_DESCRIPTOR *desc; + unsigned int i; u8 *base_ptr; base_ptr = d->arch.efi_acpi_table + acpi_get_table_offset(tbl_add, TBL_MMAP); - memory_map = (EFI_MEMORY_DESCRIPTOR *)base_ptr; + desc = (EFI_MEMORY_DESCRIPTOR *)base_ptr; - offset = 0; - for( i = 0; i < mem->nr_banks; i++, offset++ ) - fill_efi_memory_descriptor(&memory_map[offset], EfiConventionalMemory, + for ( i = 0; i < mem->nr_banks; i++, desc++ ) + fill_efi_memory_descriptor(desc, EfiConventionalMemory, mem->bank[i].start, mem->bank[i].size); - for( i = 0; i < acpi_mem.nr_banks; i++, offset++ ) - fill_efi_memory_descriptor(&memory_map[offset], EfiACPIReclaimMemory, + for ( i = 0; i < acpi_mem.nr_banks; i++, desc++ ) + fill_efi_memory_descriptor(desc, EfiACPIReclaimMemory, acpi_mem.bank[i].start, acpi_mem.bank[i].size); - fill_efi_memory_descriptor(&memory_map[offset], EfiACPIReclaimMemory, + fill_efi_memory_descriptor(desc, EfiACPIReclaimMemory, d->arch.efi_acpi_gpa, d->arch.efi_acpi_len); tbl_add[TBL_MMAP].start = d->arch.efi_acpi_gpa -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx https://lists.xenproject.org/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |