Skip to content

Commit f403f22

Browse files
Kefeng Wangakpm00
authored andcommitted
mm: kfence: use PAGE_ALIGNED helper
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]>
1 parent 0598739 commit f403f22

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

mm/kfence/kfence_test.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,9 @@ static void *test_alloc(struct kunit *test, size_t size, gfp_t gfp, enum allocat
296296

297297
if (policy == ALLOCATE_ANY)
298298
return alloc;
299-
if (policy == ALLOCATE_LEFT && IS_ALIGNED((unsigned long)alloc, PAGE_SIZE))
299+
if (policy == ALLOCATE_LEFT && PAGE_ALIGNED(alloc))
300300
return alloc;
301-
if (policy == ALLOCATE_RIGHT &&
302-
!IS_ALIGNED((unsigned long)alloc, PAGE_SIZE))
301+
if (policy == ALLOCATE_RIGHT && !PAGE_ALIGNED(alloc))
303302
return alloc;
304303
} else if (policy == ALLOCATE_NONE)
305304
return alloc;

0 commit comments

Comments
 (0)