Skip to content

Commit e19d112

Browse files
BH1SCWIngo Molnar
authored andcommitted
x86/mm: Use PAGE_ALIGNED(x) instead of IS_ALIGNED(x, PAGE_SIZE)
The <linux/mm.h> already provides the PAGE_ALIGNED() macro. Let's use this macro instead of IS_ALIGNED() and passing PAGE_SIZE directly. No change in functionality. [ mingo: Tweak changelog. ] Signed-off-by: Fanjun Kong <bh1scw@gmail.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20220526142038.1582839-1-bh1scw@gmail.com
1 parent 6f3f04c commit e19d112

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/x86/mm/init_64.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,8 +1240,8 @@ remove_pagetable(unsigned long start, unsigned long end, bool direct,
12401240
void __ref vmemmap_free(unsigned long start, unsigned long end,
12411241
struct vmem_altmap *altmap)
12421242
{
1243-
VM_BUG_ON(!IS_ALIGNED(start, PAGE_SIZE));
1244-
VM_BUG_ON(!IS_ALIGNED(end, PAGE_SIZE));
1243+
VM_BUG_ON(!PAGE_ALIGNED(start));
1244+
VM_BUG_ON(!PAGE_ALIGNED(end));
12451245

12461246
remove_pagetable(start, end, false, altmap);
12471247
}
@@ -1605,8 +1605,8 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node,
16051605
{
16061606
int err;
16071607

1608-
VM_BUG_ON(!IS_ALIGNED(start, PAGE_SIZE));
1609-
VM_BUG_ON(!IS_ALIGNED(end, PAGE_SIZE));
1608+
VM_BUG_ON(!PAGE_ALIGNED(start));
1609+
VM_BUG_ON(!PAGE_ALIGNED(end));
16101610

16111611
if (end - start < PAGES_PER_SECTION * sizeof(struct page))
16121612
err = vmemmap_populate_basepages(start, end, node, NULL);

0 commit comments

Comments
 (0)