percpu: Use ALIGN macro instead of hand coding alignment calculation
authorChristoph Lameter <cl@gentwo.org>
Thu, 19 Jun 2014 14:59:18 +0000 (09:59 -0500)
committerTejun Heo <tj@kernel.org>
Thu, 19 Jun 2014 15:00:27 +0000 (11:00 -0400)
Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
mm/percpu.c

index 2ddf9a990dbd057228782a3af5ac6901a0af632b..2139e30a4b4490da90c2e2811d5ecc901ff07d61 100644 (file)
@@ -720,8 +720,7 @@ static void __percpu *pcpu_alloc(size_t size, size_t align, bool reserved)
        if (unlikely(align < 2))
                align = 2;
 
-       if (unlikely(size & 1))
-               size++;
+       size = ALIGN(size, 2);
 
        if (unlikely(!size || size > PCPU_MIN_UNIT_SIZE || align > PAGE_SIZE)) {
                WARN(true, "illegal size (%zu) or align (%zu) for "