percpu: Use ALIGN macro instead of hand coding alignment calculation
Signed-off-by: Christoph Lameter <cl@linux.com> Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
parent
6fbc07bbe2
commit
fb009e3a99
|
@ -720,8 +720,7 @@ static void __percpu *pcpu_alloc(size_t size, size_t align, bool reserved)
|
||||||
if (unlikely(align < 2))
|
if (unlikely(align < 2))
|
||||||
align = 2;
|
align = 2;
|
||||||
|
|
||||||
if (unlikely(size & 1))
|
size = ALIGN(size, 2);
|
||||||
size++;
|
|
||||||
|
|
||||||
if (unlikely(!size || size > PCPU_MIN_UNIT_SIZE || align > PAGE_SIZE)) {
|
if (unlikely(!size || size > PCPU_MIN_UNIT_SIZE || align > PAGE_SIZE)) {
|
||||||
WARN(true, "illegal size (%zu) or align (%zu) for "
|
WARN(true, "illegal size (%zu) or align (%zu) for "
|
||||||
|
|
Loading…
Reference in New Issue