From patchwork Mon Mar 28 19:58:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Likely X-Patchwork-Id: 88682 X-Patchwork-Delegate: vanbaren@cideas.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 69850B6EDF for ; Tue, 29 Mar 2011 07:07:28 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 07A5C28335; Mon, 28 Mar 2011 22:07:26 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0DCYZ4xPsS1k; Mon, 28 Mar 2011 22:07:25 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1F2C928325; Mon, 28 Mar 2011 22:07:23 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 470C328325 for ; Mon, 28 Mar 2011 22:07:20 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0bWWLb8nBizx for ; Mon, 28 Mar 2011 22:07:19 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pz0-f44.google.com (mail-pz0-f44.google.com [209.85.210.44]) by theia.denx.de (Postfix) with ESMTPS id 1432328320 for ; Mon, 28 Mar 2011 22:07:16 +0200 (CEST) Received: by pzk30 with SMTP id 30so573725pzk.3 for ; Mon, 28 Mar 2011 13:07:15 -0700 (PDT) Received: by 10.142.139.3 with SMTP id m3mr3814623wfd.266.1301342338335; Mon, 28 Mar 2011 12:58:58 -0700 (PDT) Received: from localhost (S01060002b3d79728.cg.shawcable.net [70.72.87.49]) by mx.google.com with ESMTPS id d35sm6252254wfj.21.2011.03.28.12.58.56 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 28 Mar 2011 12:58:57 -0700 (PDT) Received: from [127.0.1.1] (localhost [127.0.0.1]) by localhost (Postfix) with ESMTP id DC63C181712; Mon, 28 Mar 2011 13:58:55 -0600 (MDT) To: u-boot@lists.denx.de, John Rigby , linaro-kernel@lists.linaro.org, wd@denx.de, vanbaren@cideas.com From: Grant Likely Date: Mon, 28 Mar 2011 13:58:55 -0600 Message-ID: <20110328195854.10235.46139.stgit@ponder> In-Reply-To: <20110328195231.10235.36716.stgit@ponder> References: <20110328195231.10235.36716.stgit@ponder> User-Agent: StGit/0.15 MIME-Version: 1.0 Cc: devicetree-discuss@lists.ozlabs.org, patches@linaro.org Subject: [U-Boot] [PATCH 4/6] Fix off-by-one error in passing initrd end address via device tree X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Grant Likely The initrd_end variable contains the address immediately *after* the initrd blob, not the last address containing data. This patch fixes an inadvertent off-by-one when setting up the initrd reserved map. Signed-off-by: Grant Likely --- common/fdt_support.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/common/fdt_support.c b/common/fdt_support.c index 6c98e5b..1b5f9c8 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -183,7 +183,7 @@ int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end, int force) } } - err = fdt_add_mem_rsv(fdt, initrd_start, initrd_end - initrd_start + 1); + err = fdt_add_mem_rsv(fdt, initrd_start, initrd_end - initrd_start); if (err < 0) { printf("fdt_initrd: %s\n", fdt_strerror(err)); return err;