[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [XENBUS PATCH] gnttab: Use for loop in GnttabRevokeForeignAccess
- To: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>, "win-pv-devel@xxxxxxxxxxxxxxxxxxxx" <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Owen Smith <owen.smith@xxxxxxxxxx>
- Date: Tue, 13 Oct 2026 12:37:22 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=ufbJGT8E4vGjyceASOwC1GVcrXTA5nnA9/7b8yxwfcA=; b=NVG+qoGy7hhPNQdqhyA9Jrcjwp9V3GCWHQuutI3Zgs/DO7WKP6YLTrqeg4LYktt+Qr325KlfV4pbpNy45F81xiNLj1SK/QvYxW2RpeZgl0jFOznBaRKhyPGSgyBAMaNr9uv0AF/cA9H7uqHbPE9Aja/URbKR0xr0T4f1t+BruJiX+EDmJ6lByqOKCNG6SfJ7lgHf/W1HUETrl9DeELgaFvZNOMa1WRR37fnwmaMjWrQzgZ/KpRya+gPuIY4KcDZckMd/G+A5kYFCIMIciMjz90fmwhq1mdSs1ZUEWcHVA8jWzC/7n3hh/c1KCD82/Sj58Xh+b+fCHpvDctiNLqCPvQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QVchzX9HP9LEuF2DcGrj6/KDv8i0glYkV3L7v5UYkIKHNMZZcdxzx+i948MblXklh0f+8fay7UOByFD1x1BSywX67//WRqqYXau0+l2lmt3z5AqxIw6tbTjgBXeiztZpBgJ8rrEVrnKYX4bbB3jOAGEXhGMcc0xtKea13jRMWtFLEhB7JKMoOps5+N/xRo0/l5zkXKyn7WhX6HSz/MyYH3JMIbYX3fIwJ6hEfV66FP5IcPuuflfe9lRVkkzemajTsS9jZ+Z5a3cxvDgGHxYUuz8Wbe7lPym00Bbv/niTMyMQqOh/td04cWbxtQWoOOG+rn81bTGjMaR8YbnO7WaIew==
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
- Authentication-results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Delivery-date: Tue, 13 Oct 2026 12:37:29 +0000
- List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>
- Msip_labels:
- Thread-index: AQHdWvl6RKebT8c0s0OBZl2k+g2Z5rb7aSsi
- Thread-topic: [XENBUS PATCH] gnttab: Use for loop in GnttabRevokeForeignAccess
Reviewed-by: Owen Smith <owen.smith@xxxxxxxxxx>
________________________________________
From: win-pv-devel <win-pv-devel-bounces@xxxxxxxxxxxxxxxxxxxx> on behalf of Tu
Dinh <ngoc-tu.dinh@xxxxxxxxxx>
Sent: 13 October 2026 10:58 AM
To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
Cc: Tu Dinh
Subject: [XENBUS PATCH] gnttab: Use for loop in GnttabRevokeForeignAccess
A while (Attempt++ < 100) loop leaves the final value at 101 after it
fails, because the value is checked before it's incremented.
Just use a normal for loop instead, which leaves the final Attempt at
100.
Signed-off-by: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
---
src/xenbus/gnttab.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/xenbus/gnttab.c b/src/xenbus/gnttab.c
index 3adcef4..bdf8b2b 100644
--- a/src/xenbus/gnttab.c
+++ b/src/xenbus/gnttab.c
@@ -571,8 +571,7 @@ GnttabRevokeForeignAccess(
flags = (volatile SHORT *)&Frame->Entry[Index].flags;
- Attempt = 0;
- while (Attempt++ < 100) {
+ for (Attempt = 0; Attempt < 100; Attempt++) {
uint16_t Old;
uint16_t New;
--
2.55.0.windows.3
--
Ngoc Tu Dinh | Vates XCP-ng Developer
XCP-ng & Xen Orchestra - Vates solutions
web: https://vates.tech
|