diff options
author | Kefeng Wang <wangkefeng.wang@huawei.com> | 2022-05-20 04:18:33 +0200 |
---|---|---|
committer | akpm <akpm@linux-foundation.org> | 2022-05-25 19:47:49 +0200 |
commit | f403f22f8ccb12860b2b62fec3173c6ccd45938b (patch) | |
tree | af18c24633a5684be6353977f56963135717eed7 /mm/kfence | |
parent | selftests: vm: add the "settings" file with timeout variable (diff) | |
download | linux-f403f22f8ccb12860b2b62fec3173c6ccd45938b.tar.xz linux-f403f22f8ccb12860b2b62fec3173c6ccd45938b.zip |
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>
Diffstat (limited to 'mm/kfence')
-rw-r--r-- | mm/kfence/kfence_test.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/mm/kfence/kfence_test.c b/mm/kfence/kfence_test.c index 1b50f70a4c0f..21aafc95f4ab 100644 --- a/mm/kfence/kfence_test.c +++ b/mm/kfence/kfence_test.c @@ -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; |