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/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>
1 parent 0598739 commit f403f22

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

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)