sparc: clarify __GFP_NOFAIL allocation
[cascardo/linux.git] / arch / sparc / kernel / mdesc.c
index 99632a8..26c80e1 100644 (file)
@@ -130,26 +130,26 @@ static struct mdesc_mem_ops memblock_mdesc_ops = {
 static struct mdesc_handle *mdesc_kmalloc(unsigned int mdesc_size)
 {
        unsigned int handle_size;
+       struct mdesc_handle *hp;
+       unsigned long addr;
        void *base;
 
        handle_size = (sizeof(struct mdesc_handle) -
                       sizeof(struct mdesc_hdr) +
                       mdesc_size);
 
+       /*
+        * Allocation has to succeed because mdesc update would be missed
+        * and such events are not retransmitted.
+        */
        base = kmalloc(handle_size + 15, GFP_KERNEL | __GFP_NOFAIL);
-       if (base) {
-               struct mdesc_handle *hp;
-               unsigned long addr;
-
-               addr = (unsigned long)base;
-               addr = (addr + 15UL) & ~15UL;
-               hp = (struct mdesc_handle *) addr;
+       addr = (unsigned long)base;
+       addr = (addr + 15UL) & ~15UL;
+       hp = (struct mdesc_handle *) addr;
 
-               mdesc_handle_init(hp, handle_size, base);
-               return hp;
-       }
+       mdesc_handle_init(hp, handle_size, base);
 
-       return NULL;
+       return hp;
 }
 
 static void mdesc_kfree(struct mdesc_handle *hp)