All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien@xen.org>
To: xen-devel@lists.xenproject.org
Cc: julien@xen.org, Julien Grall <jgrall@amazon.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>
Subject: [PATCH v2 1/3] xen: page_alloc: Don't open-code IS_ALIGNED()
Date: Fri, 15 Jul 2022 18:03:10 +0100	[thread overview]
Message-ID: <20220715170312.13931-2-julien@xen.org> (raw)
In-Reply-To: <20220715170312.13931-1-julien@xen.org>

From: Julien Grall <jgrall@amazon.com>

init_heap_pages() is using an open-code version of IS_ALIGNED(). Replace
it to improve the readability of the code.

No functional change intended.

Signed-off-by: Julien Grall <jgrall@amazon.com>

---

Changes in v2:
    - Patch added
---
 xen/common/page_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index fe0e15429af3..078c2990041d 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1823,7 +1823,7 @@ static void init_heap_pages(
             unsigned long s = mfn_x(page_to_mfn(pg + i));
             unsigned long e = mfn_x(mfn_add(page_to_mfn(pg + nr_pages - 1), 1));
             bool use_tail = (nid == phys_to_nid(pfn_to_paddr(e - 1))) &&
-                            !(s & ((1UL << MAX_ORDER) - 1)) &&
+                            IS_ALIGNED(s, 1UL << MAX_ORDER) &&
                             (find_first_set_bit(e) <= find_first_set_bit(s));
             unsigned long n;
 
-- 
2.32.0



  reply	other threads:[~2022-07-15 17:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-15 17:03 [PATCH v2 0/3] xen/mm: Optimize init_heap_pages() Julien Grall
2022-07-15 17:03 ` Julien Grall [this message]
2022-07-18  8:06   ` [PATCH v2 1/3] xen: page_alloc: Don't open-code IS_ALIGNED() Wei Chen
2022-07-18  8:11   ` Jan Beulich
2022-07-15 17:03 ` [PATCH v2 2/3] xen/heap: Split init_heap_pages() in two Julien Grall
2022-07-18  8:18   ` Wei Chen
2022-07-18 10:05     ` Julien Grall
2022-07-18  9:31   ` Jan Beulich
2022-07-18 10:08     ` Julien Grall
2022-07-18 10:57       ` Jan Beulich
2022-07-15 17:03 ` [PATCH v2 3/3] xen/heap: pass order to free_heap_pages() in heap init Julien Grall
2022-07-18  8:38   ` Wei Chen
2022-07-18  9:43   ` Jan Beulich
2022-07-18 10:24     ` Julien Grall
2022-07-18 11:02       ` Jan Beulich
2022-07-18 17:39         ` Julien Grall
2022-07-19  6:01           ` Jan Beulich
2022-07-20 18:27             ` Julien Grall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220715170312.13931-2-julien@xen.org \
    --to=julien@xen.org \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jgrall@amazon.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.