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

Yonit Halperin yhalperi at redhat.com
Tue Apr 10 03:30:36 PDT 2012


On 04/10/2012 01:06 PM, Christophe Fergeau wrote:
> 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); ?
>
I suppose it is. Didn't notice. I can remove it, or reuse ring_add_before.

Yonit.

> 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



More information about the Spice-devel mailing list