From a83a58ffe57c7d716a36ee1e3a7856f3c2da2c6f Mon Sep 17 00:00:00 2001
Message-Id: <a83a58ffe57c7d716a36ee1e3a7856f3c2da2c6f.1429703426.git.panand@redhat.com>
In-Reply-To: <de1db775d6e9b51f014442677863b57b8566c510.1429703426.git.panand@redhat.com>
References: <de1db775d6e9b51f014442677863b57b8566c510.1429703426.git.panand@redhat.com>
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
Date: Fri, 22 Aug 2014 13:48:52 +0900
Subject: [PATCH 06/15] (bugfix) calc correct end address of memory ranges in
device tree
The end address of "reg" attribute in device tree's memory should be
inclusive.
---
kexec/fs2dt.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/kexec/fs2dt.c b/kexec/fs2dt.c
index 1e5f074da8b2..3ba217873f4f 100644
--- a/kexec/fs2dt.c
+++ b/kexec/fs2dt.c
@@ -234,7 +234,8 @@ static void add_dyn_reconf_usable_mem_property__(int fd)
ranges_size*8);
}
ranges[rlen++] = cpu_to_be64(loc_base);
- ranges[rlen++] = cpu_to_be64(loc_end - loc_base);
+ ranges[rlen++] = cpu_to_be64(loc_end
+ - loc_base + 1);
rngs_cnt++;
}
}
@@ -348,7 +349,7 @@ static void add_usable_mem_property(int fd, size_t len)
ranges_size*sizeof(*ranges));
}
ranges[rlen++] = cpu_to_be64(loc_base);
- ranges[rlen++] = cpu_to_be64(loc_end - loc_base);
+ ranges[rlen++] = cpu_to_be64(loc_end - loc_base + 1);
}
}
--
2.1.0