From patchwork Thu Jul 5 17:00:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 169232 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0CF692C01CC for ; Fri, 6 Jul 2012 03:27:40 +1000 (EST) Received: from localhost ([::1]:40072 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Smpq5-0005JA-TD for incoming@patchwork.ozlabs.org; Thu, 05 Jul 2012 13:27:37 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmppG-0002iH-Dh for qemu-devel@nongnu.org; Thu, 05 Jul 2012 13:26:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SmppA-0003Qi-9k for qemu-devel@nongnu.org; Thu, 05 Jul 2012 13:26:45 -0400 Received: from mnementh.archaic.org.uk ([81.2.115.146]:55010) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmppA-0003QO-2r for qemu-devel@nongnu.org; Thu, 05 Jul 2012 13:26:40 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1SmpQC-0005lq-QH; Thu, 05 Jul 2012 18:00:52 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 5 Jul 2012 18:00:48 +0100 Message-Id: <1341507652-22155-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1341507652-22155-1-git-send-email-peter.maydell@linaro.org> References: <1341507652-22155-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 81.2.115.146 Cc: Peter Crosthwaite , patches@linaro.org Subject: [Qemu-devel] [PATCH 2/6] hw/arm_boot.c: Consistently use ram_size from arm_boot_info struct X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 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-bounces+incoming=patchwork.ozlabs.org@nongnu.org Clean up the mix of getting the RAM size from the global ram_size and from the ram_size field in the arm_boot_info structure, so that we always use the structure field. Signed-off-by: Peter Maydell Reviewed-by: Peter A. G. Crosthwaite --- hw/arm_boot.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/arm_boot.c b/hw/arm_boot.c index a1e6ddb..29ae324 100644 --- a/hw/arm_boot.c +++ b/hw/arm_boot.c @@ -357,7 +357,7 @@ void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info) if (kernel_size < 0) { entry = info->loader_start + KERNEL_LOAD_ADDR; kernel_size = load_image_targphys(info->kernel_filename, entry, - ram_size - KERNEL_LOAD_ADDR); + info->ram_size - KERNEL_LOAD_ADDR); is_linux = 1; } if (kernel_size < 0) { @@ -371,7 +371,8 @@ void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info) initrd_size = load_image_targphys(info->initrd_filename, info->loader_start + INITRD_LOAD_ADDR, - ram_size - INITRD_LOAD_ADDR); + info->ram_size + - INITRD_LOAD_ADDR); if (initrd_size < 0) { fprintf(stderr, "qemu: could not load initrd '%s'\n", info->initrd_filename);