[PATCH] memory hotadd fixes: change find_next_system_ram's return value manner
[powerpc.git] / kernel / resource.c
index 129cf04..63e8793 100644 (file)
@@ -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
@@ -404,8 +406,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