]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/resource.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
[linux-2.6-omap-h63xx.git] / kernel / resource.c
index 1d003a50ee17a1bd6291ba3cd9472ecbeb95ae27..4089d12af6e0eda2aa15cc8c145940f1bd12056c 100644 (file)
@@ -38,10 +38,6 @@ EXPORT_SYMBOL(iomem_resource);
 
 static DEFINE_RWLOCK(resource_lock);
 
-#ifdef CONFIG_PROC_FS
-
-enum { MAX_IORES_LEVEL = 5 };
-
 static void *r_next(struct seq_file *m, void *v, loff_t *pos)
 {
        struct resource *p = v;
@@ -53,6 +49,10 @@ static void *r_next(struct seq_file *m, void *v, loff_t *pos)
        return p->sibling;
 }
 
+#ifdef CONFIG_PROC_FS
+
+enum { MAX_IORES_LEVEL = 5 };
+
 static void *r_start(struct seq_file *m, loff_t *pos)
        __acquires(resource_lock)
 {
@@ -626,33 +626,34 @@ struct resource * __request_region(struct resource *parent,
 {
        struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL);
 
-       if (res) {
-               res->name = name;
-               res->start = start;
-               res->end = start + n - 1;
-               res->flags = IORESOURCE_BUSY;
+       if (!res)
+               return NULL;
 
-               write_lock(&resource_lock);
+       res->name = name;
+       res->start = start;
+       res->end = start + n - 1;
+       res->flags = IORESOURCE_BUSY;
 
-               for (;;) {
-                       struct resource *conflict;
+       write_lock(&resource_lock);
 
-                       conflict = __request_resource(parent, res);
-                       if (!conflict)
-                               break;
-                       if (conflict != parent) {
-                               parent = conflict;
-                               if (!(conflict->flags & IORESOURCE_BUSY))
-                                       continue;
-                       }
+       for (;;) {
+               struct resource *conflict;
 
-                       /* Uhhuh, that didn't work out.. */
-                       kfree(res);
-                       res = NULL;
+               conflict = __request_resource(parent, res);
+               if (!conflict)
                        break;
+               if (conflict != parent) {
+                       parent = conflict;
+                       if (!(conflict->flags & IORESOURCE_BUSY))
+                               continue;
                }
-               write_unlock(&resource_lock);
+
+               /* Uhhuh, that didn't work out.. */
+               kfree(res);
+               res = NULL;
+               break;
        }
+       write_unlock(&resource_lock);
        return res;
 }
 EXPORT_SYMBOL(__request_region);
@@ -852,7 +853,11 @@ int iomem_map_sanity_check(resource_size_t addr, unsigned long size)
                        continue;
                printk(KERN_WARNING "resource map sanity check conflict: "
                       "0x%llx 0x%llx 0x%llx 0x%llx %s\n",
-                      addr, addr + size - 1, p->start, p->end, p->name);
+                      (unsigned long long)addr,
+                      (unsigned long long)(addr + size - 1),
+                      (unsigned long long)p->start,
+                      (unsigned long long)p->end,
+                      p->name);
                err = -1;
                break;
        }