LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/mm: use PAGE_ALIGNED instead of IS_ALIGNED
@ 2022-05-26 14:20 bh1scw
  2022-05-27  2:00 ` Muchun Song
  2022-05-27 10:23 ` [tip: x86/mm] x86/mm: Use PAGE_ALIGNED(x) instead of IS_ALIGNED(x, PAGE_SIZE) tip-bot2 for Fanjun Kong
  0 siblings, 2 replies; 3+ messages in thread
From: bh1scw @ 2022-05-26 14:20 UTC (permalink / raw
  To: Dave Hansen, Andy Lutomirski, Peter Zijlstra
  Cc: H . Peter Anvin, x86, 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>
---
 arch/x86/mm/init_64.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index cb290a2f0747..39c5246964a9 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -1240,8 +1240,8 @@ remove_pagetable(unsigned long start, unsigned long end, bool direct,
 void __ref vmemmap_free(unsigned long start, unsigned long end,
 		struct vmem_altmap *altmap)
 {
-	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));
 
 	remove_pagetable(start, end, false, altmap);
 }
@@ -1605,8 +1605,8 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node,
 {
 	int err;
 
-	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));
 
 	if (end - start < PAGES_PER_SECTION * sizeof(struct page))
 		err = vmemmap_populate_basepages(start, end, node, NULL);
-- 
2.36.0


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

* Re: [PATCH] x86/mm: use PAGE_ALIGNED instead of IS_ALIGNED
  2022-05-26 14:20 [PATCH] x86/mm: use PAGE_ALIGNED instead of IS_ALIGNED bh1scw
@ 2022-05-27  2:00 ` Muchun Song
  2022-05-27 10:23 ` [tip: x86/mm] x86/mm: Use PAGE_ALIGNED(x) instead of IS_ALIGNED(x, PAGE_SIZE) tip-bot2 for Fanjun Kong
  1 sibling, 0 replies; 3+ messages in thread
From: Muchun Song @ 2022-05-27  2:00 UTC (permalink / raw
  To: bh1scw
  Cc: Dave Hansen, Andy Lutomirski, Peter Zijlstra, H . Peter Anvin,
	X86 ML, LKML

On Thu, May 26, 2022 at 10:21 PM <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: Muchun Song <songmuchun@bytedance.com>

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

* [tip: x86/mm] x86/mm: Use PAGE_ALIGNED(x) instead of IS_ALIGNED(x, PAGE_SIZE)
  2022-05-26 14:20 [PATCH] x86/mm: use PAGE_ALIGNED instead of IS_ALIGNED bh1scw
  2022-05-27  2:00 ` Muchun Song
@ 2022-05-27 10:23 ` tip-bot2 for Fanjun Kong
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Fanjun Kong @ 2022-05-27 10:23 UTC (permalink / raw
  To: linux-tip-commits; +Cc: Fanjun Kong, Ingo Molnar, x86, linux-kernel

The following commit has been merged into the x86/mm branch of tip:

Commit-ID:     e19d11267f0e6c8aff2d15d2dfed12365b4c9184
Gitweb:        https://git.kernel.org/tip/e19d11267f0e6c8aff2d15d2dfed12365b4c9184
Author:        Fanjun Kong <bh1scw@gmail.com>
AuthorDate:    Thu, 26 May 2022 22:20:39 +08:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Fri, 27 May 2022 12:19:56 +02:00

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
---
 arch/x86/mm/init_64.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 61d0ab1..8779d6b 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -1240,8 +1240,8 @@ remove_pagetable(unsigned long start, unsigned long end, bool direct,
 void __ref vmemmap_free(unsigned long start, unsigned long end,
 		struct vmem_altmap *altmap)
 {
-	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));
 
 	remove_pagetable(start, end, false, altmap);
 }
@@ -1605,8 +1605,8 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node,
 {
 	int err;
 
-	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));
 
 	if (end - start < PAGES_PER_SECTION * sizeof(struct page))
 		err = vmemmap_populate_basepages(start, end, node, NULL);

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

end of thread, other threads:[~2022-05-27 10:23 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:20 [PATCH] x86/mm: use PAGE_ALIGNED instead of IS_ALIGNED bh1scw
2022-05-27  2:00 ` Muchun Song
2022-05-27 10:23 ` [tip: x86/mm] x86/mm: Use PAGE_ALIGNED(x) instead of IS_ALIGNED(x, PAGE_SIZE) tip-bot2 for Fanjun Kong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).