[Spice-devel] [PATCH spice-common 3/6] ring: add ring_add_tail

Christophe Fergeau cfergeau at redhat.com
Tue Apr 10 03:06:54 PDT 2012


On Sun, Apr 08, 2012 at 06:42:35PM +0300, Yonit Halperin wrote:
> 
> Signed-off-by: Yonit Halperin <yhalperi at redhat.com>
> ---
>  common/ring.h |   10 ++++++++++
>  1 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/common/ring.h b/common/ring.h
> index 7fba50e..7163aaa 100644
> --- a/common/ring.h
> +++ b/common/ring.h
> @@ -61,6 +61,16 @@ static inline void ring_add(Ring *ring, RingItem *item)
>      ring->next = item->next->prev = item;
>  }
>  
> +static inline void ring_add_tail(Ring *ring, RingItem *item)

Isn't it doing the same as ring_add_before(item, ring); ?

Christophe
> +{
> +    spice_assert(ring->next != NULL && ring->prev != NULL);
> +    spice_assert(item->next == NULL && item->prev == NULL);
> +
> +    item->next = ring;
> +    item->prev = ring->prev;
> +    ring->prev = item->prev->next = item;
> +}
> +
>  static inline void ring_add_after(RingItem *item, RingItem *pos)
>  {
>      ring_add(pos, item);
> -- 
> 1.7.7.6
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20120410/b35bdcb4/attachment.pgp>


More information about the Spice-devel mailing list