[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230727011612.2721843-2-zhangpeng362@huawei.com>
Date: Thu, 27 Jul 2023 09:16:10 +0800
From: Peng Zhang <zhangpeng362@...wei.com>
To: <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>
CC: <glider@...gle.com>, <elver@...gle.com>, <dvyukov@...gle.com>,
<kasan-dev@...glegroups.com>, <akpm@...ux-foundation.org>,
<wangkefeng.wang@...wei.com>, <sunnanyong@...wei.com>,
ZhangPeng <zhangpeng362@...wei.com>
Subject: [PATCH 1/3] mm: kmsan: use helper function page_size()
From: ZhangPeng <zhangpeng362@...wei.com>
Use function page_size() to improve code readability. No functional
modification involved.
Signed-off-by: ZhangPeng <zhangpeng362@...wei.com>
---
mm/kmsan/hooks.c | 2 +-
mm/kmsan/shadow.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/kmsan/hooks.c b/mm/kmsan/hooks.c
index ec0da72e65aa..4e3c3e60ba97 100644
--- a/mm/kmsan/hooks.c
+++ b/mm/kmsan/hooks.c
@@ -117,7 +117,7 @@ void kmsan_kfree_large(const void *ptr)
page = virt_to_head_page((void *)ptr);
KMSAN_WARN_ON(ptr != page_address(page));
kmsan_internal_poison_memory((void *)ptr,
- PAGE_SIZE << compound_order(page),
+ page_size(page),
GFP_KERNEL,
KMSAN_POISON_CHECK | KMSAN_POISON_FREE);
kmsan_leave_runtime();
diff --git a/mm/kmsan/shadow.c b/mm/kmsan/shadow.c
index b8bb95eea5e3..c7de991f6d7f 100644
--- a/mm/kmsan/shadow.c
+++ b/mm/kmsan/shadow.c
@@ -210,7 +210,7 @@ void kmsan_free_page(struct page *page, unsigned int order)
return;
kmsan_enter_runtime();
kmsan_internal_poison_memory(page_address(page),
- PAGE_SIZE << compound_order(page),
+ page_size(page),
GFP_KERNEL,
KMSAN_POISON_CHECK | KMSAN_POISON_FREE);
kmsan_leave_runtime();
--
2.25.1
Powered by blists - more mailing lists