public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/6] Fix off-by-one error in passing initrd end address via device tree
Date: Mon, 28 Mar 2011 13:58:55 -0600	[thread overview]
Message-ID: <20110328195854.10235.46139.stgit@ponder> (raw)
In-Reply-To: <20110328195231.10235.36716.stgit@ponder>

From: Grant Likely <grant.likely@linaro.org>

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 <grant.likely@linaro.org>
---
 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;

  parent reply	other threads:[~2011-03-28 19:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-28 19:58 [U-Boot] [PATCH 0/6] ARM device tree support improvements Grant Likely
2011-03-28 19:58 ` [U-Boot] [PATCH 1/6] Stop passing around bootmem_base value Grant Likely
2011-04-05 13:27   ` Jerry Van Baren
2011-03-28 19:58 ` [U-Boot] [PATCH 2/6] Default to bootm_size() when CONFIG_SYS_BOOTMAPSZ is not defined Grant Likely
2011-04-05 13:34   ` Jerry Van Baren
2011-03-28 19:58 ` [U-Boot] [PATCH 3/6] Remove device tree booting dependency on CONFIG_SYS_BOOTMAPSZ Grant Likely
2011-03-28 19:58 ` Grant Likely [this message]
2011-03-28 19:59 ` [U-Boot] [PATCH 5/6] Respect memreserve regions specified in the device tree Grant Likely
2011-03-28 19:59 ` [U-Boot] [PATCH 6/6] Add CONFIG_OF_LIBFDT to more boards Grant Likely
2011-04-27 22:44   ` Wolfgang Denk
2011-04-28  9:22     ` Albert ARIBAUD
2011-04-28 12:51   ` Albert ARIBAUD
2011-03-29  6:46 ` [U-Boot] [PATCH 0/6] ARM device tree support improvements Shawn Guo
2011-04-28  0:48 ` [U-Boot] [PATCH 1/2] Remove unnecessary CONFIG_SYS_BOOTMAPSZ definition Shawn Guo
2011-04-28  0:48   ` [U-Boot] [PATCH 2/2] Fix CONFIG_OF_LIBFDT redefined warning Shawn Guo
2011-05-04  6:13 ` [U-Boot] [PATCH RESEND 1/2] mx5: Remove unnecessary CONFIG_SYS_BOOTMAPSZ definition Shawn Guo
2011-05-04  6:13   ` [U-Boot] [PATCH RESEND 2/2] mx5: Fix CONFIG_OF_LIBFDT redefined warning Shawn Guo
2011-05-04  8:04     ` Stefano Babic
2011-05-04  8:44       ` Shawn Guo
2011-05-04  8:50         ` Stefano Babic
2011-05-15 14:30     ` Stefano Babic
2011-05-15 14:31   ` [U-Boot] [PATCH RESEND 1/2] mx5: Remove unnecessary CONFIG_SYS_BOOTMAPSZ definition Stefano Babic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110328195854.10235.46139.stgit@ponder \
    --to=grant.likely@secretlab.ca \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox