]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - mm/slab_common.c
Merge remote-tracking branch 'asoc/topic/sgtl5000' into asoc-next
[karo-tx-linux.git] / mm / slab_common.c
index 13ae037c71d4d1aab1cf58989f80e97211ea3be4..538bade6df7dc2a3f27c9ad5ac5f0efc8a6d08bc 100644 (file)
@@ -373,8 +373,10 @@ struct kmem_cache *kmalloc_slab(size_t size, gfp_t flags)
 {
        int index;
 
-       if (WARN_ON_ONCE(size > KMALLOC_MAX_SIZE))
+       if (size > KMALLOC_MAX_SIZE) {
+               WARN_ON_ONCE(!(flags & __GFP_NOWARN));
                return NULL;
+       }
 
        if (size <= 192) {
                if (!size)
@@ -446,18 +448,18 @@ void __init create_kmalloc_caches(unsigned long flags)
                if (!kmalloc_caches[i]) {
                        kmalloc_caches[i] = create_kmalloc_cache(NULL,
                                                        1 << i, flags);
+               }
 
-                       /*
-                        * Caches that are not of the two-to-the-power-of size.
-                        * These have to be created immediately after the
-                        * earlier power of two caches
-                        */
-                       if (KMALLOC_MIN_SIZE <= 32 && !kmalloc_caches[1] && i == 6)
-                               kmalloc_caches[1] = create_kmalloc_cache(NULL, 96, flags);
+               /*
+                * Caches that are not of the two-to-the-power-of size.
+                * These have to be created immediately after the
+                * earlier power of two caches
+                */
+               if (KMALLOC_MIN_SIZE <= 32 && !kmalloc_caches[1] && i == 6)
+                       kmalloc_caches[1] = create_kmalloc_cache(NULL, 96, flags);
 
-                       if (KMALLOC_MIN_SIZE <= 64 && !kmalloc_caches[2] && i == 7)
-                               kmalloc_caches[2] = create_kmalloc_cache(NULL, 192, flags);
-               }
+               if (KMALLOC_MIN_SIZE <= 64 && !kmalloc_caches[2] && i == 7)
+                       kmalloc_caches[2] = create_kmalloc_cache(NULL, 192, flags);
        }
 
        /* Kmalloc array is now usable */
@@ -536,12 +538,12 @@ static void *s_start(struct seq_file *m, loff_t *pos)
        return seq_list_start(&slab_caches, *pos);
 }
 
-void *s_next(struct seq_file *m, void *p, loff_t *pos)
+void *slab_next(struct seq_file *m, void *p, loff_t *pos)
 {
        return seq_list_next(p, &slab_caches, pos);
 }
 
-void s_stop(struct seq_file *m, void *p)
+void slab_stop(struct seq_file *m, void *p)
 {
        mutex_unlock(&slab_mutex);
 }
@@ -618,8 +620,8 @@ static int s_show(struct seq_file *m, void *p)
  */
 static const struct seq_operations slabinfo_op = {
        .start = s_start,
-       .next = s_next,
-       .stop = s_stop,
+       .next = slab_next,
+       .stop = slab_stop,
        .show = s_show,
 };