[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] Use List macros to manipulate lists
On 07/03/2022 07:49, Durrant, Paul wrote: 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. Oh, I see that stops us making a bunch of sanity checks. Not really worth it then. Paul 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);
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |