mm, slab: initialize object alignment on cache creation
[platform/adaptation/renesas_rcar/renesas_kernel.git] / mm / slab.c
index 6dd8d5f..ea854eb 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2189,7 +2189,8 @@ static int __init_refok setup_cpu_cache(struct kmem_cache *cachep, gfp_t gfp)
 int
 __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags)
 {
-       size_t left_over, freelist_size, ralign;
+       size_t left_over, freelist_size;
+       size_t ralign = BYTES_PER_WORD;
        gfp_t gfp;
        int err;
        size_t size = cachep->size;
@@ -2222,14 +2223,6 @@ __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags)
                size &= ~(BYTES_PER_WORD - 1);
        }
 
-       /*
-        * Redzoning and user store require word alignment or possibly larger.
-        * Note this will be overridden by architecture or caller mandated
-        * alignment if either is greater than BYTES_PER_WORD.
-        */
-       if (flags & SLAB_STORE_USER)
-               ralign = BYTES_PER_WORD;
-
        if (flags & SLAB_RED_ZONE) {
                ralign = REDZONE_ALIGN;
                /* If redzoning, ensure that the second redzone is suitably