From patchwork Mon Jul 16 13:24:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 10007 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id D978D23F2A for ; Mon, 16 Jul 2012 13:24:22 +0000 (UTC) Received: from mail-gh0-f180.google.com (mail-gh0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id A1391A188A3 for ; Mon, 16 Jul 2012 13:24:22 +0000 (UTC) Received: by ghbz12 with SMTP id z12so5352129ghb.11 for ; Mon, 16 Jul 2012 06:24:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=i2Q+PC/zBbA1FO+XkVkMuCdp7IQBq8dl3OqvL6DN5EA=; b=RGOp2FxthlwscUTYCWiI/jpeQFkqQXXE/F/1qD5HP9B8BNY0kk1Wa3NgPUYcakVbKv SGgheoZ/4KQoCwMkq43oNmVCTcuJwI3G3x3CGw/HQ9GgO3MFiufOUluEZxmvxU49hGUa /mmaDPEF6DoJ9pCpBged5UUq1aedWnKuEEZpeWton8Z3UBWspplHoQTX/Fm4abAdwot2 0KobQGuDg0k7XQFLNk9YUbvmaNcGvBSuJsbdbdy30/thZ0Z4oo4CIGm9EAL1d9HugCXh vf00z81DZqSly3V218+CQxTL6+lh8QxvKfY6WTqrx5niMRwGSsCsrXohuz49binachwD obBg== Received: by 10.50.160.198 with SMTP id xm6mr5252433igb.0.1342445061615; Mon, 16 Jul 2012 06:24:21 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.241.2 with SMTP id lc2csp7930ibb; Mon, 16 Jul 2012 06:24:20 -0700 (PDT) Received: by 10.236.165.102 with SMTP id d66mr9130061yhl.54.1342445060506; Mon, 16 Jul 2012 06:24:20 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id j14si5894194anm.158.2012.07.16.06.24.19 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 Jul 2012 06:24:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1SqlHd-0002Nk-3P; Mon, 16 Jul 2012 14:24:17 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Peter Crosthwaite Subject: [PATCH v2 2/6] hw/arm_boot.c: Consistently use ram_size from arm_boot_info struct Date: Mon, 16 Jul 2012 14:24:12 +0100 Message-Id: <1342445056-9129-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1342445056-9129-1-git-send-email-peter.maydell@linaro.org> References: <1342445056-9129-1-git-send-email-peter.maydell@linaro.org> X-Gm-Message-State: ALoCoQlOcV3M5a4lsFYRR5eEgl806cbHt+yh6P1WGLC8wcgKds7TqGxKQK7hYmq9n//bbqP4WEPr 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);