summaryrefslogtreecommitdiffstats
path: root/kernel/resource.c
diff options
context:
space:
mode:
authorDavid Woodhouse2006-08-31 00:30:38 +0200
committerDavid Woodhouse2006-08-31 00:30:38 +0200
commit0a7d5f8ce960e74fa22986bda4af488539796e49 (patch)
treee29ad17808a5c3410518e22dae8dfe94801b59f3 /kernel/resource.c
parentMTD: Add lock/unlock operations for Atmel AT49BV6416 (diff)
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6 (diff)
downloadkernel-qcow2-linux-0a7d5f8ce960e74fa22986bda4af488539796e49.tar.gz
kernel-qcow2-linux-0a7d5f8ce960e74fa22986bda4af488539796e49.tar.xz
kernel-qcow2-linux-0a7d5f8ce960e74fa22986bda4af488539796e49.zip
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'kernel/resource.c')
-rw-r--r--kernel/resource.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/kernel/resource.c b/kernel/resource.c
index 129cf046e561..46286434af80 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -244,6 +244,7 @@ int find_next_system_ram(struct resource *res)
start = res->start;
end = res->end;
+ BUG_ON(start >= end);
read_lock(&resource_lock);
for (p = iomem_resource.child; p ; p = p->sibling) {
@@ -254,15 +255,17 @@ int find_next_system_ram(struct resource *res)
p = NULL;
break;
}
- if (p->start >= start)
+ if ((p->end >= start) && (p->start < end))
break;
}
read_unlock(&resource_lock);
if (!p)
return -1;
/* copy data */
- res->start = p->start;
- res->end = p->end;
+ if (res->start < p->start)
+ res->start = p->start;
+ if (res->end > p->end)
+ res->end = p->end;
return 0;
}
#endif
@@ -404,8 +407,6 @@ int insert_resource(struct resource *parent, struct resource *new)
return result;
}
-EXPORT_SYMBOL(insert_resource);
-
/*
* Given an existing resource, change its start and size to match the
* arguments. Returns -EBUSY if it can't fit. Existing children of