mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
mm/slab.c: replace open-coded round-up code with ALIGN
Link: http://lkml.kernel.org/r/20170616072918epcms5p4ff16c24ef8472b4c3b4371823cd87856@epcms5p4 Signed-off-by: Canjiang Lu <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: Pekka Enberg <[email protected]> Cc: David Rientjes <[email protected]> Cc: Joonsoo Kim <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
e6d0e1dcf5
commit
e077195029
1 changed files with 2 additions and 6 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Reference in a new issue