From: Owen Smith Date: Thu, 3 Mar 2022 15:06:21 +0000 (+0000) Subject: Use List macros to manipulate lists X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=f5ff63880b2d0698f99e273af32c64d9429b00ee;p=pvdrivers%2Fwin%2Fxenbus.git Use List macros to manipulate lists Signed-off-by: Owen Smith Added comment to note when list removal occurs Signed-off-by: Paul Durrant --- diff --git a/src/xenbus/cache.c b/src/xenbus/cache.c index 8dcb3a7..13fb0e5 100644 --- a/src/xenbus/cache.c +++ b/src/xenbus/cache.c @@ -688,12 +688,12 @@ 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)); + // Actual list removal is done in CacheDestroySlab() + ListEntry = Cache->SlabList.Blink; + ASSERT(ListEntry != &Cache->SlabList); Slab = CONTAINING_RECORD(ListEntry, XENBUS_CACHE_SLAB, ListEntry); @@ -705,8 +705,6 @@ CacheSpill( break; CacheDestroySlab(Cache, Slab); - - ListEntry = Prev; } CacheAudit(Cache);