aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/resource.c
diff options
context:
space:
mode:
authorKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>2006-08-05 15:14:59 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-08-06 11:57:48 -0400
commit0f04ab5efbca73ab366a156d96b073d2da35b158 (patch)
tree53da6790d43c370c56699e093e7c9ba6ad310ea6 /kernel/resource.c
parent6f712711dbd180aa3777efe5ae3b9b0e915b9471 (diff)
[PATCH] memory hotadd fixes: change find_next_system_ram's return value manner
find_next_system_ram() returns valid memory range which meets requested area, only used by memory-hot-add. This function always rewrite requested resource even if returned area is not fully fit in requested one. And sometimes the returnd resource is larger than requested area. This annoyes the caller. This patch changes the returned value to fit in requested area. Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Keith Mannthey <kmannth@gmail.com> Cc: Yasunori Goto <y-goto@jp.fujitsu.com> Cc: Dave Hansen <haveblue@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/resource.c')
-rw-r--r--kernel/resource.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/resource.c b/kernel/resource.c
index 0dd3a857579e..63e879379dbd 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -261,8 +261,10 @@ int find_next_system_ram(struct resource *res)
261 if (!p) 261 if (!p)
262 return -1; 262 return -1;
263 /* copy data */ 263 /* copy data */
264 res->start = p->start; 264 if (res->start < p->start)
265 res->end = p->end; 265 res->start = p->start;
266 if (res->end > p->end)
267 res->end = p->end;
266 return 0; 268 return 0;
267} 269}
268#endif 270#endif