[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] libelf: drop struct elf_dom_parms' virt_offset member



commit a00a3e1aa2844d4819d74e9b1df6eb66a6e07252
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Fri Aug 5 17:59:32 2016 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri Aug 5 17:59:32 2016 +0200

    libelf: drop struct elf_dom_parms' virt_offset member
    
    It's being used solely by elf_xen_addr_calc_check(), and hence can be
    a local variable there.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/common/libelf/libelf-dominfo.c | 12 +++++++-----
 xen/include/xen/libelf.h           |  1 -
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/xen/common/libelf/libelf-dominfo.c 
b/xen/common/libelf/libelf-dominfo.c
index ec69449..bdd3273 100644
--- a/xen/common/libelf/libelf-dominfo.c
+++ b/xen/common/libelf/libelf-dominfo.c
@@ -404,6 +404,8 @@ static elf_errorstatus elf_xen_note_check(struct elf_binary 
*elf,
 static elf_errorstatus elf_xen_addr_calc_check(struct elf_binary *elf,
                                    struct elf_dom_parms *parms)
 {
+    uint64_t virt_offset;
+
     if ( (parms->elf_paddr_offset != UNSET_ADDR) &&
          (parms->virt_base == UNSET_ADDR) )
     {
@@ -439,9 +441,9 @@ static elf_errorstatus elf_xen_addr_calc_check(struct 
elf_binary *elf,
                 __FUNCTION__, parms->elf_paddr_offset);
     }
 
-    parms->virt_offset = parms->virt_base - parms->elf_paddr_offset;
-    parms->virt_kstart = elf->pstart + parms->virt_offset;
-    parms->virt_kend   = elf->pend   + parms->virt_offset;
+    virt_offset = parms->virt_base - parms->elf_paddr_offset;
+    parms->virt_kstart = elf->pstart + virt_offset;
+    parms->virt_kend   = elf->pend   + virt_offset;
 
     if ( parms->virt_entry == UNSET_ADDR )
         parms->virt_entry = elf_uval(elf, elf->ehdr, e_entry);
@@ -450,13 +452,13 @@ static elf_errorstatus elf_xen_addr_calc_check(struct 
elf_binary *elf,
     {
         elf_parse_bsdsyms(elf, elf->pend);
         if ( elf->bsd_symtab_pend )
-            parms->virt_kend = elf->bsd_symtab_pend + parms->virt_offset;
+            parms->virt_kend = elf->bsd_symtab_pend + virt_offset;
     }
 
     elf_msg(elf, "%s: addresses:\n", __FUNCTION__);
     elf_msg(elf, "    virt_base        = 0x%" PRIx64 "\n", parms->virt_base);
     elf_msg(elf, "    elf_paddr_offset = 0x%" PRIx64 "\n", 
parms->elf_paddr_offset);
-    elf_msg(elf, "    virt_offset      = 0x%" PRIx64 "\n", parms->virt_offset);
+    elf_msg(elf, "    virt_offset      = 0x%" PRIx64 "\n", virt_offset);
     elf_msg(elf, "    virt_kstart      = 0x%" PRIx64 "\n", parms->virt_kstart);
     elf_msg(elf, "    virt_kend        = 0x%" PRIx64 "\n", parms->virt_kend);
     elf_msg(elf, "    virt_entry       = 0x%" PRIx64 "\n", parms->virt_entry);
diff --git a/xen/include/xen/libelf.h b/xen/include/xen/libelf.h
index d430c83..90bd8cb 100644
--- a/xen/include/xen/libelf.h
+++ b/xen/include/xen/libelf.h
@@ -428,7 +428,6 @@ struct elf_dom_parms {
     uint32_t phys_entry;
 
     /* calculated */
-    uint64_t virt_offset;
     uint64_t virt_kstart;
     uint64_t virt_kend;
 };
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.