|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [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
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |