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

Re: [PATCH] Use List macros to manipulate lists


  • To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
  • From: "Durrant, Paul" <xadimgnik@xxxxxxxxx>
  • Date: Mon, 7 Mar 2022 07:49:10 +0000
  • Delivery-date: Mon, 07 Mar 2022 07:49:14 +0000
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

On 03/03/2022 15:06, Owen Smith wrote:
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);

If we want to go down this road then this should really be 'RemoveListHead()'. I'll fix up on commit.

Acked-by: Paul Durrant <paul@xxxxxxx>

Slab = CONTAINING_RECORD(ListEntry, XENBUS_CACHE_SLAB, ListEntry); @@ -705,8 +704,6 @@ CacheSpill(
              break;
CacheDestroySlab(Cache, Slab);
-
-        ListEntry = Prev;
      }
CacheAudit(Cache);




 


Rackspace

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