I think that it makes it somewhat more obvious what is going on
if structures are memcpy'd, rather than relying on dereferanced pointer
assignment.
 
Signed-Off-By: Simon Horman <[EMAIL PROTECTED]>

Index: kexec-tools-patch-boot-params/purgatory/arch/ia64/purgatory-ia64.c
===================================================================
--- kexec-tools-patch-boot-params.orig/purgatory/arch/ia64/purgatory-ia64.c     
2006-09-20 15:51:33.000000000 +0900
+++ kexec-tools-patch-boot-params/purgatory/arch/ia64/purgatory-ia64.c  
2006-09-20 15:52:25.000000000 +0900
@@ -162,12 +162,12 @@
                unsigned long mstart, mend;
                src_md = src;
                dst_md = dest;
+               memcpy(dst_md, src_md, sizeof(efi_memory_desc_t));
                if (src_md->num_pages == 0)
                        continue;
                mstart = src_md->phys_addr;
                mend = src_md->phys_addr +
                        (src_md->num_pages << EFI_PAGE_SHIFT);
-               *dst_md = *src_md;
                if (src_md->type == EFI_LOADER_DATA)
                        dst_md->type = EFI_CONVENTIONAL_MEMORY;
                // segments are already sorted and aligned to 4K
@@ -194,7 +194,8 @@
                                dst_md->num_pages = start_pages;
                                dest += memdesc_size;
                                dst_md = dest;
-                               *dst_md = *src_md;
+                               memcpy(dst_md, src_md,
+                                      sizeof(efi_memory_desc_t));
                        }
                        dst_md->phys_addr = seg->start;
                        dst_md->num_pages = mid_pages;
@@ -203,7 +204,8 @@
                        if (end_pages) {
                                dest += memdesc_size;
                                dst_md = dest;
-                               *dst_md = *src_md;
+                               memcpy(dst_md, src_md,
+                                      sizeof(efi_memory_desc_t));
                                dst_md->phys_addr = seg->end;
                                dst_md->num_pages = end_pages;
                                dst_md->type = orig_type;

--

-- 
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/

_______________________________________________
fastboot mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/fastboot

Reply via email to