From patchwork Mon Jul 30 17:37:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Lackorzynski X-Patchwork-Id: 951253 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=l4re.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41fSBM5cqtz9ryl for ; Tue, 31 Jul 2018 04:04:11 +1000 (AEST) Received: from localhost ([::1]:55153 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fkCWf-0003dO-HW for incoming@patchwork.ozlabs.org; Mon, 30 Jul 2018 14:04:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fkC8q-0006OO-5K for qemu-devel@nongnu.org; Mon, 30 Jul 2018 13:39:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fkC8m-0002wJ-LR for qemu-devel@nongnu.org; Mon, 30 Jul 2018 13:39:32 -0400 Received: from os.inf.tu-dresden.de ([141.76.48.99]:50662) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fkC8m-0002uQ-Dj for qemu-devel@nongnu.org; Mon, 30 Jul 2018 13:39:28 -0400 Received: from erwin.inf.tu-dresden.de ([141.76.48.80] helo=os.inf.tu-dresden.de) by os.inf.tu-dresden.de with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) id 1fkC6d-0004Bz-Hg for qemu-devel@nongnu.org; Mon, 30 Jul 2018 19:37:15 +0200 Date: Mon, 30 Jul 2018 19:37:12 +0200 From: Adam Lackorzynski To: qemu-devel@nongnu.org Message-ID: <20180730173712.GG4987@os.inf.tu-dresden.de> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 141.76.48.99 X-Mailman-Approved-At: Mon, 30 Jul 2018 14:03:38 -0400 Subject: [Qemu-devel] [PATCH] arm: Fix return code of arm_load_elf X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Use an int64_t as a return type to restore the negative check for arm_load_as. Signed-off-by: Adam Lackorzynski --- hw/arm/boot.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index e09201cc97..ca9467e583 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -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;