Skip to content

Commit

Permalink
[PATCH] memory hotadd fixes: change find_next_system_ram's return val…
Browse files Browse the repository at this point in the history
…ue 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>
  • Loading branch information
KAMEZAWA Hiroyuki authored and Linus Torvalds committed Aug 6, 2006
1 parent 6f71271 commit 0f04ab5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kernel/resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,10 @@ int find_next_system_ram(struct resource *res)
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
Expand Down

0 comments on commit 0f04ab5

Please sign in to comment.