linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: kfence: Use PAGE_ALIGNED helper
@ 2022-05-20  2:18 Kefeng Wang
  2022-05-20  7:43 ` Marco Elver
  2022-05-20 10:26 ` Muchun Song
  0 siblings, 2 replies; 6+ messages in thread
From: Kefeng Wang @ 2022-05-20  2:18 UTC (permalink / raw)
  To: Marco Elver, Alexander Potapenko, Dmitry Vyukov, Andrew Morton,
	linux-mm, kasan-dev
  Cc: Kefeng Wang

Use PAGE_ALIGNED macro instead of IS_ALIGNED and passing PAGE_SIZE.

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 mm/kfence/kfence_test.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/mm/kfence/kfence_test.c b/mm/kfence/kfence_test.c
index 96206a4ee9ab..a97bffe0cc3e 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;
-- 
2.35.3



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-05-23  7:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-20  2:18 [PATCH] mm: kfence: Use PAGE_ALIGNED helper Kefeng Wang
2022-05-20  7:43 ` Marco Elver
2022-05-20 10:26 ` Muchun Song
2022-05-23  6:32   ` Kefeng Wang
2022-05-23  6:46     ` Muchun Song
2022-05-23  7:13       ` Kefeng Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).