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/[email protected]
Signed-off-by: Kefeng Wang <[email protected]>
Acked-by: Muchun Song <[email protected]>
Cc: Marco Elver <[email protected]>
Cc: Alexander Potapenko <[email protected]>
Cc: Dmitry Vyukov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • 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.