[Spice-devel] [PATCH spice-common 1/3] ring: Remove __ring_remove function

Frediano Ziglio fziglio at redhat.com
Tue Nov 7 10:58:33 UTC 2017


Is just used by ring_remove, no reason to have it.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 common/ring.h | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/common/ring.h b/common/ring.h
index 4b0e313..036c098 100644
--- a/common/ring.h
+++ b/common/ring.h
@@ -70,19 +70,14 @@ static inline void ring_add_before(RingItem *item, RingItem *pos)
     ring_add(pos->prev, item);
 }
 
-static inline void __ring_remove(RingItem *item)
-{
-    item->next->prev = item->prev;
-    item->prev->next = item->next;
-    item->prev = item->next = NULL;
-}
-
 static inline void ring_remove(RingItem *item)
 {
     spice_assert(item->next != NULL && item->prev != NULL);
     spice_assert(item->next != item);
 
-    __ring_remove(item);
+    item->next->prev = item->prev;
+    item->prev->next = item->next;
+    item->prev = item->next = NULL;
 }
 
 static inline RingItem *ring_get_head(Ring *ring)
-- 
2.13.6



More information about the Spice-devel mailing list