Commit 0f04ab5e authored by KAMEZAWA Hiroyuki's avatar KAMEZAWA Hiroyuki Committed by Linus Torvalds

[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: default avatarKAMEZAWA 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: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 6f712711
...@@ -261,7 +261,9 @@ int find_next_system_ram(struct resource *res) ...@@ -261,7 +261,9 @@ int find_next_system_ram(struct resource *res)
if (!p) if (!p)
return -1; return -1;
/* copy data */ /* copy data */
if (res->start < p->start)
res->start = p->start; res->start = p->start;
if (res->end > p->end)
res->end = p->end; res->end = p->end;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment