[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 1/3] xen: page_alloc: Don't open-code IS_ALIGNED()
- To: Julien Grall <julien@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- From: Wei Chen <Wei.Chen@xxxxxxx>
- Date: Mon, 18 Jul 2022 16:06:45 +0800
- Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RG8CVJ9twEL0jibBQYHZJdG7LC/Za2m6QYKX22a9tcc=; b=KTFH4Esw9VllXXQGNG/7rqOI4P7VsISJ+u6Y5V/pVjwvV/BkJ/PGa1wFoL4fTQnS4k1v9kzMrLKr0XMhCtX6f7Sl+/sEe/SPAGE5kmYIZ0sdMQFJzrzo1AzB6Cn5Q7h/lZmxzEKzxDj5vgjap03Ih2HB0AS432l5MVEOiHqDDpCuvyWUcb6TQQcye1Xn4djfkSEylbBy7sg+9G1iOafudmMx6c6Y5ImUOxc5OmJ+p2cl1A96notdpWUJnXAVrR2Jk5udL3IWGyOuw7u2UrLZay/9wy9y2PjjVFKbhxVJeOTBtVwO2bYlw9C4mBJSt8nlHb9BmU1mLMHD3U2JsXOe7g==
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RG8CVJ9twEL0jibBQYHZJdG7LC/Za2m6QYKX22a9tcc=; b=NyTIhJoYfBjqVLwDDIdTym0mFptY7ZyIVUo1pO7R+yLvZFSd/mmlTeCtX6zpS5h87eMyomLQZx3FgyCMyP/ScNg7/gbD0AC5mbJQ2cHPXsJq3MIAv74nLNm3I+8qbgLbXK83vaQcBBfQW0UEQvFhnn4coc05cNd95L5RwLAjA0qAetgPlvADzNJ3G87h5pn9t2la4U+HxxNe+/ld7iOFOd0jwLau/AiqpC2XHqnh+bi2k3F1JH3M+ntMGGfu5HzHZ1kfRmB7QsohrXcTGak788it/My8UBSZJ8p7CZc2G7+iyHBevU8uqMglCj43TYu15xeLVJdVV7Ve/0EGfZCD6g==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=A+y0QDEL0lXX4i7fACShDLGiKJgmWyiJiL1rN0m4kryVbTiDFLixJrpmLw4jpkgXwBHLC0EEN2Ek6AiZI+bQBKrtT3RaDa2KHTCCNoZbn3rRYU4HnK/X8/NXEHjIX1zx0hRMpWNVhNyazc6ukYOWTQVWe3Oes4WgRAsEMY+ITzbW/In0Qbg8Tk5SVCvNd3xHF5R+sjKjZixTky1CKquPxZtVavY13R0DMTgTSv7d8IA70B9DhZdT86Sb8l4MHFMw+VxcUgNLR71Q7YfijtodwTEi5VqPRPd7aV2ZjgWm/uTpgw6yqWi+KSvfPGqIJMFiRpghqjbcstTKPjmn+L6AXw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y5tiM9DfloIyvhdU7+YsiG8gux+F+gN7Jvp16D3SVwAb1C6OPqXCS6xJuU4KHU6EKkfooDmzyXAxLcUvGRsIjykO6F6Sm89YgGWQcsz0wVyS4czbv5rDzdKhWySAiN5ea3YRFk9EaHpGGJIzTqdUqeW8G716BUQPZv3ZeEJ6QlLYrq5zPXZALu0Fc//QZrMr+YFbdOFrN0Eq7IIOtnVDh+O/62FFdjfZRW45j5xf8QlGD0uakohNb96idK/B0PytKp6dn4K2sUwe5NcNY5KQcV28foyYX/vmvczfEpzHUPs1l4qzlcCLAtIHToQAW+XGVyeeDvcxbogKzL1aSwxkPA==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: Julien Grall <jgrall@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
- Delivery-date: Mon, 18 Jul 2022 08:07:21 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
Hi Julien,
On 2022/7/16 1:03, Julien Grall wrote:
From: Julien Grall <jgrall@xxxxxxxxxx>
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@xxxxxxxxxx>
---
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;
LGTM.
Reviewed-by: Wei Chen <Wei.Chen@xxxxxxx>
|