summaryrefslogtreecommitdiff
path: root/kernel/range.c
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2010-02-10 12:20:13 +0300
committerH. Peter Anvin <hpa@zytor.com>2010-02-11 04:47:17 +0300
commite9a0064ad03b899938059bb576615ad9ed0f27f9 (patch)
treeb1c7dd0c7844fb4b8f56bb991684ece56bcd6e1c /kernel/range.c
parent284f933d45a1e60404328440910bc2651c0fb51d (diff)
downloadlinux-e9a0064ad03b899938059bb576615ad9ed0f27f9.tar.xz
x86: Change range end to start+size
So make interface more consistent with early_res. Later we can share some code with early_res. Signed-off-by: Yinghai Lu <yinghai@kernel.org> LKML-Reference: <1265793639-15071-10-git-send-email-yinghai@kernel.org> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'kernel/range.c')
-rw-r--r--kernel/range.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/kernel/range.c b/kernel/range.c
index 71e0021281fe..74e2e6114927 100644
--- a/kernel/range.c
+++ b/kernel/range.c
@@ -13,7 +13,7 @@
int add_range(struct range *range, int az, int nr_range, u64 start, u64 end)
{
- if (start > end)
+ if (start >= end)
return nr_range;
/* Out of slots: */
@@ -33,7 +33,7 @@ int add_range_with_merge(struct range *range, int az, int nr_range,
{
int i;
- if (start > end)
+ if (start >= end)
return nr_range;
/* Try to merge it with old one: */
@@ -46,7 +46,7 @@ int add_range_with_merge(struct range *range, int az, int nr_range,
common_start = max(range[i].start, start);
common_end = min(range[i].end, end);
- if (common_start > common_end + 1)
+ if (common_start > common_end)
continue;
final_start = min(range[i].start, start);
@@ -65,7 +65,7 @@ void subtract_range(struct range *range, int az, u64 start, u64 end)
{
int i, j;
- if (start > end)
+ if (start >= end)
return;
for (j = 0; j < az; j++) {
@@ -79,15 +79,15 @@ void subtract_range(struct range *range, int az, u64 start, u64 end)
}
if (start <= range[j].start && end < range[j].end &&
- range[j].start < end + 1) {
- range[j].start = end + 1;
+ range[j].start < end) {
+ range[j].start = end;
continue;
}
if (start > range[j].start && end >= range[j].end &&
- range[j].end > start - 1) {
- range[j].end = start - 1;
+ range[j].end > start) {
+ range[j].end = start;
continue;
}
@@ -99,11 +99,11 @@ void subtract_range(struct range *range, int az, u64 start, u64 end)
}
if (i < az) {
range[i].end = range[j].end;
- range[i].start = end + 1;
+ range[i].start = end;
} else {
printk(KERN_ERR "run of slot in ranges\n");
}
- range[j].end = start - 1;
+ range[j].end = start;
continue;
}
}