[PATCH 3/3] Use a macro to simplify ring_get_length

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

 



Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 common/ring.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/common/ring.h b/common/ring.h
index b13bc7d..4b0e313 100644
--- a/common/ring.h
+++ b/common/ring.h
@@ -155,9 +155,7 @@ static inline unsigned int ring_get_length(Ring *ring)
     RingItem *i;
     unsigned int ret = 0;
 
-    for (i = ring_get_head(ring);
-         i != NULL;
-         i = ring_next(ring, i))
+    RING_FOREACH(i, ring)
         ret++;
 
     return ret;
-- 
2.7.4

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]