Skip to content

Commit

Permalink
mm: kmsan: use helper macros PAGE_ALIGN and PAGE_ALIGN_DOWN
Browse files Browse the repository at this point in the history
Use helper macros PAGE_ALIGN and PAGE_ALIGN_DOWN to improve code
readability.  No functional modification involved.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: ZhangPeng <[email protected]>
Reviewed-by: Alexander Potapenko <[email protected]>
Cc: Dmitry Vyukov <[email protected]>
Cc: Kefeng Wang <[email protected]>
Cc: Marco Elver <[email protected]>
Cc: Nanyong Sun <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
ZhangPeng authored and akpm00 committed Aug 21, 2023
1 parent 4852a80 commit 108c3dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mm/kmsan/shadow.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 108c3dc

Please sign in to comment.