From: ZhangPeng Date: Thu, 27 Jul 2023 01:16:12 +0000 (+0800) Subject: mm: kmsan: use helper macros PAGE_ALIGN and PAGE_ALIGN_DOWN X-Git-Tag: v6.6-rc1~156^2~233 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=108c3dc6cd3dbe36824469b7ea860337978e0439;p=thirdparty%2Fkernel%2Flinux.git mm: kmsan: use helper macros PAGE_ALIGN and PAGE_ALIGN_DOWN Use helper macros PAGE_ALIGN and PAGE_ALIGN_DOWN to improve code readability. No functional modification involved. Link: https://lkml.kernel.org/r/20230727011612.2721843-4-zhangpeng362@huawei.com Signed-off-by: ZhangPeng Reviewed-by: Alexander Potapenko Cc: Dmitry Vyukov Cc: Kefeng Wang Cc: Marco Elver Cc: Nanyong Sun Signed-off-by: Andrew Morton --- diff --git a/mm/kmsan/shadow.c b/mm/kmsan/shadow.c index 966994268a017..87318f9170f19 100644 --- a/mm/kmsan/shadow.c +++ b/mm/kmsan/shadow.c @@ -281,8 +281,8 @@ void __init kmsan_init_alloc_meta_for_range(void *start, void *end) struct page *page; u64 size; - start = (void *)ALIGN_DOWN((u64)start, PAGE_SIZE); - size = ALIGN((u64)end - (u64)start, PAGE_SIZE); + start = (void *)PAGE_ALIGN_DOWN((u64)start); + size = PAGE_ALIGN((u64)end - (u64)start); shadow = memblock_alloc(size, PAGE_SIZE); origin = memblock_alloc(size, PAGE_SIZE); for (u64 addr = 0; addr < size; addr += PAGE_SIZE) {