mm: use PAGE_ALIGNED instead of IS_ALIGNED
Subsystems (2)
PATCH 1/1 mm: use PAGE_ALIGNED instead of IS_ALIGNED
From: Fanjun Kong <[email protected]>
The <linux/mm.h> already provides the PAGE_ALIGNED macro. Let's use this macro instead of IS_ALIGNED and passing PAGE_SIZE directly.
Signed-off-by Fanjun Kong <[email protected]>
--- mm/sparse-vmemmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
mm/sparse-vmemmap.c +2 -2
@@ -200,8 +200,8 @@ static int vmemmap_remap_range(unsigned long start, unsigned long end,unsigned long next;pgd_t *pgd; -VM_BUG_ON (!IS_ALIGNED (start,PAGE_SIZE )); -VM_BUG_ON (!IS_ALIGNED (end,PAGE_SIZE )); +VM_BUG_ON (!PAGE_ALIGNED (start)); +VM_BUG_ON (!PAGE_ALIGNED (end)); pgd =pgd_offset_k (addr); do {
Signature · 1 line
2.36.0
Quoted 6 lines · On Thu, May 26, 2022 at 10:02:57PM +0800, [email protected] wrote:
From: Fanjun Kong <[email protected]>
The <
linux/mm.h> already provides thePAGE_ALIGNEDmacro. Let's use this macro instead ofIS_ALIGNEDand passingPAGE_SIZEdirectly.Signed-off-by Fanjun Kong <[email protected]>
Acked-by Muchun Song <[email protected]>
Thanks.
Quoted 6 lines · On 2022/5/26 22:02, [email protected] wrote:
From: Fanjun Kong <[email protected]>
The <
linux/mm.h> already provides thePAGE_ALIGNEDmacro. Let's use this macro instead ofIS_ALIGNEDand passingPAGE_SIZEdirectly.Signed-off-by Fanjun Kong <[email protected]>
Reviewed-by Miaohe Lin <[email protected]>
Thanks!
Quoted 20 lines
--- mm/sparse-vmemmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)mm/sparse-vmemmap.c +2
-2@@ -200,8 +200,8 @@ static int vmemmap_remap_range(unsigned long start, unsigned long end,unsigned long next;pgd_t *pgd; -VM_BUG_ON (!IS_ALIGNED (start,PAGE_SIZE )); -VM_BUG_ON (!IS_ALIGNED (end,PAGE_SIZE )); +VM_BUG_ON (!PAGE_ALIGNED (start)); +VM_BUG_ON (!PAGE_ALIGNED (end)); pgd =pgd_offset_k (addr); do {