All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm: use PAGE_ALIGNED instead of IS_ALIGNED
@ 2022-05-26 14:02 bh1scw
  2022-05-26 14:54 ` Muchun Song
  2022-05-27  1:48 ` Miaohe Lin
  0 siblings, 2 replies; 3+ messages in thread
From: bh1scw @ 2022-05-26 14:02 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-mm, linux-kernel, Muchun Song, Fanjun Kong

From: Fanjun Kong <bh1scw@gmail.com>

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 <bh1scw@gmail.com>
---
 mm/sparse-vmemmap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c
index f4fa61dbbee3..49cb15cbe590 100644
--- a/mm/sparse-vmemmap.c
+++ b/mm/sparse-vmemmap.c
@@ -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 {
-- 
2.36.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm: use PAGE_ALIGNED instead of IS_ALIGNED
  2022-05-26 14:02 [PATCH] mm: use PAGE_ALIGNED instead of IS_ALIGNED bh1scw
@ 2022-05-26 14:54 ` Muchun Song
  2022-05-27  1:48 ` Miaohe Lin
  1 sibling, 0 replies; 3+ messages in thread
From: Muchun Song @ 2022-05-26 14:54 UTC (permalink / raw)
  To: bh1scw; +Cc: Andrew Morton, linux-mm, linux-kernel

On Thu, May 26, 2022 at 10:02:57PM +0800, bh1scw@gmail.com wrote:
> From: Fanjun Kong <bh1scw@gmail.com>
> 
> 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 <bh1scw@gmail.com>

Acked-by: Muchun Song <songmuchun@bytedance.com>

Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm: use PAGE_ALIGNED instead of IS_ALIGNED
  2022-05-26 14:02 [PATCH] mm: use PAGE_ALIGNED instead of IS_ALIGNED bh1scw
  2022-05-26 14:54 ` Muchun Song
@ 2022-05-27  1:48 ` Miaohe Lin
  1 sibling, 0 replies; 3+ messages in thread
From: Miaohe Lin @ 2022-05-27  1:48 UTC (permalink / raw)
  To: bh1scw; +Cc: linux-mm, linux-kernel, Muchun Song, Andrew Morton

On 2022/5/26 22:02, bh1scw@gmail.com wrote:
> From: Fanjun Kong <bh1scw@gmail.com>
> 
> 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 <bh1scw@gmail.com>

Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>

Thanks!

> ---
>  mm/sparse-vmemmap.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c
> index f4fa61dbbee3..49cb15cbe590 100644
> --- a/mm/sparse-vmemmap.c
> +++ b/mm/sparse-vmemmap.c
> @@ -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 {
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-27  1:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-26 14:02 [PATCH] mm: use PAGE_ALIGNED instead of IS_ALIGNED bh1scw
2022-05-26 14:54 ` Muchun Song
2022-05-27  1:48 ` Miaohe Lin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.