Skip to content

Commit

Permalink
mm: kfence: use PAGE_ALIGNED helper
Browse files Browse the repository at this point in the history
Use PAGE_ALIGNED macro instead of IS_ALIGNED and passing PAGE_SIZE.

Link: https://lkml.kernel.org/r/20220520021833.121405-1-wangkefeng.wang@huawei.com
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Acked-by: Muchun Song <songmuchun@bytedance.com>
Cc: Marco Elver <elver@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
Kefeng Wang authored and akpm00 committed May 25, 2022
1 parent 0598739 commit f403f22
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions mm/kfence/kfence_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,9 @@ static void *test_alloc(struct kunit *test, size_t size, gfp_t gfp, enum allocat

if (policy == ALLOCATE_ANY)
return alloc;
if (policy == ALLOCATE_LEFT && IS_ALIGNED((unsigned long)alloc, PAGE_SIZE))
if (policy == ALLOCATE_LEFT && PAGE_ALIGNED(alloc))
return alloc;
if (policy == ALLOCATE_RIGHT &&
!IS_ALIGNED((unsigned long)alloc, PAGE_SIZE))
if (policy == ALLOCATE_RIGHT && !PAGE_ALIGNED(alloc))
return alloc;
} else if (policy == ALLOCATE_NONE)
return alloc;
Expand Down

0 comments on commit f403f22

Please sign in to comment.