Skip to contentSkip to conversation

arm: Fix return code of arm_load_elf

PATCH Applied Adam Lackorzynski 2 participants 2 messages Jul 30, 2018 – Aug 2, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: Fix return code of arm_load_elf

Use an int64_t as a return type to restore
the negative check for arm_load_as.

---
 hw/arm/boot.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
hw/arm/boot.c +4 -4
index e09201cc97..ca9467e583 100644
@@ -818,9 +818,9 @@ static int do_arm_linux_init(Object *obj, void *opaque)
     return 0;
 }
 
-static uint64_t arm_load_elf(struct arm_boot_info *info, uint64_t *pentry,
-                             uint64_t *lowaddr, uint64_t *highaddr,
-                             int elf_machine, AddressSpace *as)
+static int64_t arm_load_elf(struct arm_boot_info *info, uint64_t *pentry,
+                            uint64_t *lowaddr, uint64_t *highaddr,
+                            int elf_machine, AddressSpace *as)
 {
     bool elf_is64;
     union {
@@ -829,7 +829,7 @@ static uint64_t arm_load_elf(struct arm_boot_info *info, uint64_t *pentry,
     } elf_header;
     int data_swab = 0;
     bool big_endian;
-    uint64_t ret = -1;
+    int64_t ret = -1;
     Error *err = NULL;
 
 
Signature · 1 line
2.18.0
#1 lore raw
Quoted 7 lines · Adam Lackorzynski

Use an int64_t as a return type to restore
the negative check for arm_load_as.

---
 hw/arm/boot.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Applied to target-arm.for-3.1, thanks.

-- PMM