Revert to Fedora kernel-2.6.17-1.2187_FC5 patched with vs2.0.2.1; there are too many...
[linux-2.6.git] / kernel / resource.c
index 5f013dc..e3080fc 100644 (file)
@@ -39,7 +39,7 @@ struct resource iomem_resource = {
 
 EXPORT_SYMBOL(iomem_resource);
 
-static rwlock_t resource_lock = RW_LOCK_UNLOCKED;
+static DEFINE_RWLOCK(resource_lock);
 
 #ifdef CONFIG_PROC_FS
 
@@ -91,7 +91,7 @@ static int r_show(struct seq_file *m, void *v)
        return 0;
 }
 
-struct seq_operations resource_op = {
+static struct seq_operations resource_op = {
        .start  = r_start,
        .next   = r_next,
        .stop   = r_stop,
@@ -263,10 +263,10 @@ static int find_resource(struct resource *root, struct resource *new,
                        new->start = min;
                if (new->end > max)
                        new->end = max;
-               new->start = (new->start + align - 1) & ~(align - 1);
+               new->start = ALIGN(new->start, align);
                if (alignf)
                        alignf(alignf_data, new, size, align);
-               if (new->start < new->end && new->end - new->start + 1 >= size) {
+               if (new->start < new->end && new->end - new->start >= size - 1) {
                        new->end = new->start + size - 1;
                        return 0;
                }
@@ -430,10 +430,9 @@ EXPORT_SYMBOL(adjust_resource);
  */
 struct resource * __request_region(struct resource *parent, unsigned long start, unsigned long n, const char *name)
 {
-       struct resource *res = kmalloc(sizeof(*res), GFP_KERNEL);
+       struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL);
 
        if (res) {
-               memset(res, 0, sizeof(*res));
                res->name = name;
                res->start = start;
                res->end = start + n - 1;
@@ -465,7 +464,7 @@ struct resource * __request_region(struct resource *parent, unsigned long start,
 
 EXPORT_SYMBOL(__request_region);
 
-int __deprecated __check_region(struct resource *parent, unsigned long start, unsigned long n)
+int __check_region(struct resource *parent, unsigned long start, unsigned long n)
 {
        struct resource * res;