[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Use List macros to manipulate lists


  • To: <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Owen Smith <owen.smith@xxxxxxxxxx>
  • Date: Thu, 3 Mar 2022 15:06:21 +0000
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Owen Smith <owen.smith@xxxxxxxxxx>
  • Delivery-date: Thu, 03 Mar 2022 15:06:53 +0000
  • Ironport-data: A9a23:LGCZYqgjfr8z0gux/6Nh5dNoX161AxAKZh0ujC45NGQN5FlHY01je htvX2uPMqyCYmX9e9h0OYnl8BhSvsKDzIdnGQJqrXgyEXwb9cadCdqndUqhZCn6wu8v7a5EA 2fyTvGacajYm1eF/k/F3oDJ9CU6jefSLlbFILas1hpZHGeIcw98z0M78wIFqtQw24LhWFvW4 YmaT/D3YzdJ5RYlagr41IrbwP9flKyaVOQw5wFWiVhj5TcyplFNZH4tDfjZw0jQG+G4KtWSV efbpIxVy0uCl/sb5nFJpZ6gGqECaua60QFjERO6UYD66vRJjnRaPqrWqJPwwKqY4tmEt4kZ9 TlDiXC/YSMYGJ32s7ghaQRRLQggH49o0qDMG1Hq5KR/z2WeG5ft6/BnDUVwNowE4OdnR2pJ8 JT0KhhUMErF3bjvhuvmFK883azPL+GyVG8bknZ/wDefFvMnXZDrSKTW/95Imjw3g6iiGN6AO ppBMmM3MXwsZTV9HllHCqMezNv0m3nOeiwB8GKMt6setj27IAtZj+G2bYu9lsaxbdpUmAOAu CfK8nr0BjkeNceD0nyV/3S0nOjNkCjnHoUIG9WFGuVC2QPJgDZJUVtPCAX98aLRZlOCt8x3D 30yyhAF8ZQI6UWVZ4fffTOSv3W+l0tJMzZPKNES5AaIw6vSxg+WAGkYUzJMAOAbWN8KqS8Cj QHQwY6wbdB7mPjMEC/GqO/Ixd+nEXVNdQc/iTk4oRzpCjUJiKU6lVrxQ9lqC8ZZZfWlSGirk 1hmQMXT7oj/bPLnNY3mpTgrYBr2//AlqzLZAC2NBApJCSsjOeaYi3SAswSz0Bq5BN/xoqO9l HYFgdOCy+sFEIuAkieAKM1UQu33varbbGyH3gM2d3XEy9hL0yT5FWy3yGsjTHqFz+5eIWO5C KMtkVk5CGBv0IuCMvYsPtPZ5zUCxqn8D9X1Ps04nfIVCqWdgDSvpXk0DWbJhjiFuBF1zckXY M7LGe7xXSdyIfk2l1KeGrZCuYLHMwhjnAs/s7iglE/5uVdfDVbIIYo43KymNbhovPvZ+1yOq 76y9aKikn1ibQE3WQGPmaZ7ELzABSNT6UzewyCPStO+Hw==
  • Ironport-hdrordr: A9a23:QNGVDqGEQSYMQB9LpLqE08eALOsnbusQ8zAXPiFKOGRom6mj/f xG885rsSMc5AxhPU3I3OrwWpVoIkm9yXcW2/h3AV7KZmCP01dAbrsSjrcKqAeQfREWmNQtrJ uIsJITNDQzNzVHZArBjjVQ2uxOoeW6zA==
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>
---
 src/xenbus/cache.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/xenbus/cache.c b/src/xenbus/cache.c
index 8dcb3a7..576d6ca 100644
--- a/src/xenbus/cache.c
+++ b/src/xenbus/cache.c
@@ -688,12 +688,11 @@ CacheSpill(
     if (Cache->Count <= Count)
         goto done;
 
-    ListEntry = Cache->SlabList.Blink;
-    while (ListEntry != &Cache->SlabList) {
-        PLIST_ENTRY         Prev = ListEntry->Blink;
+    while (!IsListEmpty(&Cache->SlabList)) {
         PXENBUS_CACHE_SLAB  Slab;
 
-        ASSERT(!IsListEmpty(&Cache->SlabList));
+        ListEntry = Cache->SlabList.Blink;
+        ASSERT(ListEntry != &Cache->SlabList);
 
         Slab = CONTAINING_RECORD(ListEntry, XENBUS_CACHE_SLAB, ListEntry);
 
@@ -705,8 +704,6 @@ CacheSpill(
             break;
 
         CacheDestroySlab(Cache, Slab);
-
-        ListEntry = Prev;
     }
 
     CacheAudit(Cache);
-- 
2.33.0.windows.2




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.