|
@@ -2040,17 +2040,13 @@ __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags)
|
|
|
* unaligned accesses for some archs when redzoning is used, and makes
|
|
|
* sure any on-slab bufctl's are also correctly aligned.
|
|
|
*/
|
|
|
- if (size & (BYTES_PER_WORD - 1)) {
|
|
|
- size += (BYTES_PER_WORD - 1);
|
|
|
- size &= ~(BYTES_PER_WORD - 1);
|
|
|
- }
|
|
|
+ size = ALIGN(size, BYTES_PER_WORD);
|
|
|
|
|
|
if (flags & SLAB_RED_ZONE) {
|
|
|
ralign = REDZONE_ALIGN;
|
|
|
/* If redzoning, ensure that the second redzone is suitably
|
|
|
* aligned, by adjusting the object size accordingly. */
|
|
|
- size += REDZONE_ALIGN - 1;
|
|
|
- size &= ~(REDZONE_ALIGN - 1);
|
|
|
+ size = ALIGN(size, REDZONE_ALIGN);
|
|
|
}
|
|
|
|
|
|
/* 3) caller mandated alignment */
|